未捕获的TypeError:无法读取属性' _aData'未定义的

时间:2017-06-30 09:36:27

标签: javascript jquery sql-server

当我从laql中的sqlserver数据库返回数据时抛出这个问题,但是当我从mysql数据库返回数据时,它运行良好,数据没有区别,我需要帮助。



$('#example-select-all').on('click', function(){
    // Get all rows with search applied
    var rows = table.rows({ 'search': 'applied' }).nodes();
    console.log(rows);
    // Check/uncheck checkboxes for all rows in the table
    $('input[type="checkbox"]', rows).prop('checked', this.checked);
});

$('#target_table tbody').on('change', 'input[type="checkbox"]', function(){
    // If checkbox is not checked
    if(!this.checked){
        var el = $('#example-select-all').get(0);
        // If "Select all" control is checked and has 'indeterminate' property
        if(el && el.checked && ('indeterminate' in el)){
            // Set visual state of "Select all" control
            // as 'indeterminate'
            el.indeterminate = true;
        }
        var $row = $(this).closest('tr');
        $row.removeClass('selected');
        console.log($row);
        // Get row data
        console.log(table1.row($row));
        var data = table1.row($row).data();
        console.log(data);
        index=rows_selected.indexOf(data.id)
        rows_selected.splice(index,1);
        console.log(rows_selected);
    }
    else{
        var $row = $(this).closest('tr');
        $row.addClass('selected');
        console.log($row);
        // Get row data
        var data = table1.row($row).data();

        rows_selected.push(data.id);
        console.log(rows_selected);

    }




`

0 个答案:

没有答案