jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › Selecting next row (or previous if was last) upon row deletion
Tagged: treegrid row selection, treegrid selection
This topic contains 4 replies, has 2 voices, and was last updated by Marc 11 years, 1 month ago.
-
Author
-
Hi,
Unless I’m wrong, in a tree grid, when deleting a row, no other row gets selected. I would like to select, upon deletion, either the next row, either, if it was last, the previous one. ‘Last’ and ‘previous’ referring to the sequence as it appears on screen.
Is there a setting that allows to do it ? Or if not, is there a way of navigating (previous / next) the tree grid according to the currently displayed sequence, regardless of database ID or expanded/collapsed rows ?
Thank you.
Hi Marc,
You can change the TreeGrid’s selected row through the API – selectRow(http://jsfiddle.net/jqwidgets/24RfH/), unselectRow(http://jsfiddle.net/jqwidgets/R7HpR/), clearSelection(http://jsfiddle.net/jqwidgets/6wY27/)
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Thank you for helping,
Actually, I was aware of the selectRow and unselectRow methods in the treeGrid API. Thank you for the pointer anyway.
Maybe it has to do with my way of asking questions (presenting the context first : this was the first section of my post – and then asking the actual question : this was the second section), but my true question is : “is there a way of navigating (previous / next) the tree grid ?”.
Maybe I’m missing something obvious, and sorry about that, I’m just getting started with jqWidgets. The issue I’m having is that, in the treeGrid that I’ve coded, bound to a table in an SQL Server database, the rowid is the ID in the database table. And they are displayed in the grid in random sequence, eg. 5, 3, 45, 11, etc., depending on the hierarchical sorting.
So I cannot assume that rowid-- will return the previous row, and rowid++ the next one.
Is there a way of getting the previous/next row, in the order rows are displayed in the grid ?
Thank you, and please don’t hesitate to let me know if my question is not clear enough.
Best regards.
Hi Marc,
You have a point. There is no API for getting the ID of the previous displayed row. We will have to add such. This means that the only option in your scenario could be to clear the selection.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Pete,
“Not implemented yet” is still an answer
I’ll know I don’t need to spend time investigating further.
Thank you for taking the time to reply.
Best regards
-
AuthorPosts
You must be logged in to reply to this topic.