Set Selected Row Focus
Set Selected Row Focus
Toyb
Posts: 19Questions: 9Answers: 1
I'm using "rowId:" to capture the current selected row before refreshing my datatable. After refresh I can re-select the row.
ActiveTable.api().rows().deselect();
ActiveTable.api().row("#" + ActiveRowId).select();
QUESTION: How can I set the cell focus on the selected row?
PROBLEM: After refreshing data and setting the previously selected row the focus is lost and using arrow keys no longer moves the row selection to the next row.
Thank for the help!
This question has an accepted answers - jump to answer
Answers
Are you using the keyTable extension? If so then maybe you can use
cell().focus()
.Kevin
Yes, using the KeyTable Extension.
My code has progressed to this and still does not work...
Ok, found the problem.
CODE NEEDED:
PROBLEM: My program disables user keystrokes during data refresh. While preventing user keystrokes it apparently prevents code behind from working, even though .select was being set correctly, etc. and appeared to be working.
Keys needs to be enabled when setting focus...
Thanks for the help!
You can probably do something like this:
It will save an extra API call. Checkout the
row-selector
andcolumn-selector
for thecell()
API for more details.Kevin