column(id) bug?
column(id) bug?
Hello, i/m trying to add some custom datatable + editor to my web page. And i faced one strange problem. My table is exactly the same as https://editor.datatables.net/examples/advanced/joinArray.html, but with my database info ofc. And i'm trying to add some custom search to this table like:
// "my_table" is a name of the table var.
$("#myButton").click( function(){ my_table.column(1).search("Test").draw(); });
and it doesn't work at all (doesn't procwss search). I found, that problem is that .column(id) selector doesn't work.
- I tryed somwthing like this at first:
$("#myButton").click( function(){ var x = my_table.data(); alert(x); });
and it's working fine. - Then i tryed this:
$("#myButton").click( function(){ var x = my_table.cloumn(1).data(); alert(x); });
and in that case it doesn't work.
I will be very gratefull to see any suggestions.
edited by allan - 2014-06-11 - formatting
This question has an accepted answers - jump to answer
Answers
How are you initialising the table - or more specifically what is
my_table
? My guess is that you have$(...).dataTable()
- but you want$(...).DataTable()
- see the FAQs.Allan
oh, f..in sh..it, sorry, my bad, that is so stupid mistake, thak you wery much, and sorry that i forced u to edit my message, but i didn't find how i can do it by myself when i wrote this question.
No worries, and good to hear you've got it working now :-)
Allan