Datatable: Access button in specific cell

Hi,

After clicking on a button in a datatable I would like to get access to another button that is on the same row but in a different column.
When I use dtable.locate(event) I get the current button and also row and column indices (rind, cind). Maybe there is a way to use these parameters to get to the next button?

It took me quite some time to realize how to add buttons to a datatable and how to attach handlers to them. Therefore I decided to put up a little example which illustrates my current problem and at the same time shows 2 different ways on how to add buttons to a datatable. Hope this will be of use to other new users.

Hi,

Active elements in the items of data components (like datatable) are not only bit more specific towards normal buttons, but also it should be pointed to that any button (checkbox, div element, etc.) that is drawn with the help of a component template is one and the same object drawn multiple times. Webix buttons have one and the same id, so do native html buttons.

As I’ve already said, now these’s no specific API for getting to these buttons, but one can get the html of any data item, and in case of datatable/treetable - to any data item cell.

var itemNode = datatable.getItem({row:rowsId, column:columnId}); 

And then work with HTML. To access an object of a Webix button, you should get to its top div view_id attribute and use it like $$(view_id).

//here - button is the only content of the node
var button = itemNode.childNodes[0]; 
var webix_button = $$(itemNode.childNodes[0].getAttribute("view_id"));