jQuery datatables: test if datatables plugin is initialized -


i want check if table element say, id="datatable" datatables-initialized. this:

if ($('#datatable').datatable().initialized) {   alert("initialized!"); } else {       alert("not initialized!");     } 

how can that? thanks!

first, add special class name when you're initializing datatables:

$('.datatable').not('.initialized').addclass('initialized').datatable() 

and can tell them apart class name:

alert( $('#datatable').hasclass('initialized') ) 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -