Hi!
Thanks for your post and sorry for the trouble!
It looks like you are trying to use a DataTables API call here. This should likely happen upon interaction with external controls, like buttons, so that I recommend registering callback handles to those in JavaScript. This can, to some degree, also happen inside of a “Custom Command”, but with the information you have given, I’m not yet really able to provide more guidance here. Sorry.
(By the way, an alternative could be to use the TablePress premium “Row Filtering” feature module.)
Regards,
Tobias
Thanks for the swift reply, much appreciated. All I’m trying to do is only show rows that have a particular word in a particular column – is that possible with a custom command please?
Hi,
I really recommend the Row Filtering module for that, but yes, this should be possible with a “Custom Command” as well:
initComplete: function () {
this.api().column( 3 ).search( 'VACANT' ).draw();
}
(This example would filter column 4, indicated by the 3, for “VACANT” anywhere in it.)
This approach does however have the drawback that the full table is sent from the server to the visitor’s browser, regardless of some rows then likely not being needed.
Regards,
Tobias