Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can't I access the JQuery DataTables API?

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I'm trying to use the JQuery DataTables plugin :
I have the following code...
Code:
    // intialise data table
    oFP = $('#fp_promotions_table').dataTable({
        
        "sDom": 'R<"H"fr>t<"F"ip>',            
	    "bJQueryUI": true,
		"sPaginationType": "full_numbers",
		"iDisplayLength": 25
    });

Which renders fine.

However, as soon as I try to access the API I just get errors...
Code:
    // pre-filter to show active by default
    oFP.api().column(5).search( 'Active' ).draw();
fails with
oFP.api is not a function

I've tried
Code:
.[b]D[/b]ataTable(..)
    oFP.column(5).search( 'Active' ).draw();
But that just errors saying column is not a function.

I've tried both methods as described in the API :
Nothing works? What am I doing wrong?

Thanks,
1DMF.

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Ignore me! [banghead]

I was using version 1.9.4, and have just found that the API is only available in v1.10.0.

d'oh!

It's working perfectly since I upgraded, though now my table doesn't render as nice, never rains eh!

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top