Using search plugins with DataTables 3.0

Using search plugins with DataTables 3.0

kthorngrenkthorngren Posts: 22,495Questions: 26Answers: 5,169

Public service announcement :smiley: Found, after upgrading to 3.0, that search plugins using the settings.nTable.id settings object will break. Looks like that object has been replaced with settings.tableId. However it would be better to use the table().node() API to get the table's ID. Better might be to convert to search.fixed() which I believe is the DT 2+ replacement for search plugins.

@allan I believe settings.nTable.id is used by many developers. Please add something to the upgrade notes about the appropriate steps to take.

Kevin

Replies

  • allanallan Posts: 65,863Questions: 1Answers: 10,957 Site admin

    Hi Kevin,

    Very good point.

    In this section about internal property naming I've just committed the following:

    As an example, one property that was used to get the table ID was .nTable.id (where nTable was DataTables' cached node for the table element). This property is now called simply table, so you could update your code to use settings.table.id. However, I would strongly advise you to not use the private properties, and instead use table().node() to get the table node.

    That will be deployed to the site shortly.

    Allan

  • kthorngrenkthorngren Posts: 22,495Questions: 26Answers: 5,169

    Perfect, thanks!

    Kevin

Sign In or Register to comment.