Spreadsheets / WickedGrid

Easy & Wicked Fast spreadsheets for the web
http://spreadsheets.github.io/WickedGrid
587 stars 131 forks source link

check table on empty #88

Closed dellert closed 8 years ago

dellert commented 8 years ago

how can I check table on empty? Can somebody help?)

dellert commented 8 years ago

found a solution

function isEmptyTable(data) {
    // data is json data object from $.sheet.dts.fromTables.json()
    var d = 0;

    $.each(data[0].rows, function(i, row) {
        $.each(row.columns, function(j , col) {
            if(col.value != undefined) {
                d++;
            }
        });
    });

    return d == 0;
};