Two questions concerning a row in a DataTable programmatically:
If I use $$(‘datatable-id’).select(row-id) the row is not colored as a selected row, so one can’t see which row was selected. How can I achieve this?
If a function is defined for ‘onAfterSelect’, the parameter of the call is the object of the row-id if the row is selected manually (by click), but a strange object if selected via api programmatically. Is there any possibility to get here also the object of the selected row?
It would be nice to have the functionality of a row-selection by click also for a row-selection programmatically (as in dhtmlx)
The id parameter for onAfterSelect is the same object, the only difference - in case of programmatic selection, the object will not have id.column property
Hallo Victor,
thank you for your quick response. You are right, the selection works. I debugged my script again, and it seems that the problem arises with the ‘onAfterSelect’ call. A type error is thrown e:undefined in webix.js line 12.
Call stack trace:
webix.extend.Wk.Vk.jl (webix.js:12)
webix.extend.Wk.row.gl (webix.js:12)
webix.extend.Wk.Vk.dl (webix.js:12)
webix.extend.Wk.row.select (webix.js:12)
selectPart (process.js:400)
setData (process.js:389)
(anonymous function) (process.js:481)
stateChange (utils.js:27)
(anonymous function) (utils.js:27)
update: if I run an onAfterSelect call in your example snippet at http://webix.com/snippet/b6753238 it works fine. So, there must be still a bug in my code.
Sorry for my previous posts, please consider this topic as closed.