Clicking the cells

You can make the Table body clickable. The rowindex and cellindex refer to the indexes in the JSON arrays and not the table as shown on the screen. They are in other words not affected by sorting and paging and searching.

  • var popup = ts.ui.Notification;
    ts.ui.get('#example8', table => {
    	table.rows([
    		['A', 'D', 'G'],
    		['B', 'E', 'H'],
    		['C', 'F', 'I']
    	]);
    	table.clickable(function(rowindex, cellindex) {
    		popup.success('Row ' + rowindex + ', Cell ' + cellindex);
    	});
    });