Saturday, 15 June 2013

JQuery DataTables Plugin API - method not associated with table variable -



JQuery DataTables Plugin API - method not associated with table variable -

when using jquery.datatables run next problem consistently when trying redraw table ajax source, occurs of api methods effort use.

i using version 1.10.

example

var table = $('#table').datatable( { initcomplete: function(settings, json) { .... }, ajax: 'url', serverside: true, order: [[2, 'desc']], statesave: true, language: { "lengthmenu": "display _menu_ records per page", "zerorecords": "nothing found", "infoempty": "nothing found", "infofiltered": "(filtered _max_ total records)" }, lengthmenu: [[10, 25, 50, -1], [10, 25, 50, "all"]], pagelength: 10, lengthchange: true, ordering: true, paging: true, processing: false, searching: true }); setinterval(function(){ table .datatable() .order( [[ 2, 'asc' ]] ) .draw( false ); }, 30000);

error

uncaught typeerror: object [object object] has no method 'order'

this re-create of example posted in dt site, exception of dt in illustration passing additional parameters upon initialization.

i know error due table object not having methods .datatable(), other not sure how working draw(false), or other api method.

the part gets me a,

table.fndraw();

works fine....

thank help in advance.

change this:

setinterval(function(){ table .datatable() .order( [[ 2, 'asc' ]] ) .draw( false ); }, 30000);

to:

setinterval(function(){ table .api() .order( [[ 2, 'asc' ]] ) .draw( false ); }, 30000);

jquery datatable

No comments:

Post a Comment