rocky
1
Hi Everyone:
With the code below, I am trying to message out the row id … but this.getItemValue(id) is coming up undefined.
var user = “”;
var cog = “”;
var conf = [{ id:“title”, fillspace:true },
{ id:“Icons Buttons”, width:200, template:user+cog}];
webix.ui({ rows:[
{ view:“datatable”, columns:conf, data:grid_data,
onClick:{
“fa-user”:function(){
webix.message("USER id = " + this.getItemValue(id));
},
“fa-cog”:function(){
webix.message("COG id = " + this.getItemValue(id));
}
}
}
] });
maksim
2
Where you have found the reference to getItemValue method ? There is no such one. You can use
//this.getItemValue(id);
var id = this.getItem(id).id;
var title = this.getItem(id).title;
Made the change but getting ‘uncaught referenceerror: id’ … I even used function(id)… and that still errored out.
var user = "<span class='fa-user webix_icon'></span>";
var cog = "<span class='webix_icon fa-cog'></span>";
var conf = [{ id:"title", fillspace:true },
{ id:"Icons Buttons", width:200, template:user+cog}];
webix.ui({ rows:[
{ view:"datatable", columns:conf, data:grid_data,
onClick:{
"fa-user":function(){
webix.message("USER id = " + this.getItem(id).id);
},
"fa-cog":function(){
webix.message("COG id = " + this.getItem(id).id);
}
}
}
] });
maksim
4
this code works with first page on multi paging data table. when i navigate to next page it still returns same id. please advise. thnks
Hello @jaybangia,
As far I can see, it work fine: https://snippet.webix.com/zih807qb
If it’s possible, could you please provide an example (via our snippet tool or in any other way) where the issue can be seen?