column(id) bug?

column(id) bug?

doshdikdoshdik Posts: 3Questions: 2Answers: 0
edited June 2014 in Free community support

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.

  1. I tryed somwthing like this at first: $("#myButton").click( function(){ var x = my_table.data(); alert(x); }); and it's working fine.
  2. 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

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited June 2014 Answer ✓

    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

  • doshdikdoshdik Posts: 3Questions: 2Answers: 0

    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.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    No worries, and good to hear you've got it working now :-)

    Allan

This discussion has been closed.