Search code examples
yadcf

yadcf settingsDt is undefined in jqueryUI tabs


I have yadcf working on DataTables in a jqueryUI tabbed environment. When you first load the page, it works correctly.

However, when you click away to another tab, then come back to the previous tab, DataTables blows up and sends the error:

TypeError: settingsDt is undefined from line 438 in jquery.dataTables.yadcf.js >(if (settingsDt.oSavedState != undefined && settingsDt.oSavedState.ColReorder >!== undefined) {...)

I have a demo up for you to look at: www.novobpm.com/yadcf

Click on the "Part Master" tab, it works. Then click on "Part Alerts." All is OK.

Now go back to "Part Master" and it'll blow up. The error is in the console. Interestingly, if you now click on "Part Alerts" again, that table is blown up.

var oTable;
oTable = $('#part_master').DataTable( {
    ajax: 'tables/parts/table.part_master.php',
    dom: 'B<"clear">frtip', 
    pagingType:'full_numbers',
    order: [[ 0, 'asc' ]],
    processing: true, 
    pageLength : 10,
    searching: true,

    columns: [ 

        { data: 'part_master.part_number' },
        { data: 'part_master.part_description' },
        { data: 'part_master.part_status' },
        { data: 'part_master.add_leadtime_days' },
        { data: 'part_master.add_leadtime_name' },
        { data: 'part_master.max_pph' }
    ],
    select: true,      
    buttons: [
        { extend: "create", editor: editor },
        { extend: "edit",   editor: editor }//,
              ],
    InitComplete: function (settings, json) { }
           } );

    yadcf.init(oTable,[{
    column_number: 0,
    filter_type: "multi_select",
    select_type: 'chosen'        
    }, {
    column_number: 1,
    filter_type: "auto_complete"
    }, {
    column_number: 2
    }, {
    column_number: 3
    }, {
    column_number: 4
    }, {
    column_number: 5,
    filter_type: "range_number_slider"
    },
]);

Solution

  • Go grab 0.9.0.beta.7 should work now.

    Next time you get an error in browser console, feel free to open an issue