filtering - Page 2
filtering
This discussion has been closed.
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
© 2007-2023 MIT licensed. Privacy policy. Supporters.
SpryMedia Ltd is registered in Scotland, company no. SC456502.
Answers
I saw that error I think Wasn't sure yet where it was coming from. But it makes sense that it is from the plugin. Thanks!
Kevin
That was an easy fix. I just added a check for
rowPosition < 0
to handle the case where the row index is not found usingindexOf()
. It stays on the current page.http://live.datatables.net/sijixiho/6/edit
Kevin
Thanks, Kevin - all tested and good. I've updated the code, so all good to use.
Cheers,
Colin
I like that
Kevin
Hello @kthorngren @colin @Allan
Thanks all for your work
I'm just coming back to office now.
You are right for these 2 points.
My first question (or second perhaps) was... How to know if a selected row (table.row( {selected: true} )) was visible and if yes how to display it at filter change time...
the corrected row().show() can take care of filter cative and this is a good point, but if the row is hidden by filter expression, row().show() try to go to page -1... and a cannot read property error is uncaught.
I'll modify api to set page to 0 if -1...
Because for me the utility is to unselect row if selected and not visible, I do a test at return to verify if selected is in current displayed page...
Thanks all
PS perhaps an api extension to give param as GoToPageIfNotVisible and boolparam DeselectIfNotVisible should be a way to do that...
final (tested but... I'll do more test later)
tested and tested...
At start I'd like to show the selected record, if visible.
The status visible or not may change at filter set (global or column)
Concerning global filtering table.one(... is the correct way, but column filter change event not need to use table.one... If using at startup .one( event is not fired and results are nor each time ok.
So use
and everything seem to be OK
Tks a lot @kthorngren , @colin, @allan
about row().show() I did not see you did solve the problem when no row to display using
Sorry for that. It's all ok now