new ejs.grids.Grid({
....
dataBound: function() {
var items = [
{
text: 'Detail'
},
{
text: 'Send Message'
},
{
text: 'Delete'
}];
// initialize DropDownButton control
var drpDownBtn = new ejs.splitbuttons.DropDownButton({items: items});
// Render initialized DropDownButton.
drpDownBtn.appendTo('.employee-button');
}
});
grid.appendTo('#Grid');
|
var grid = new ejs.grids.Grid({
....
dataBound: function () {
var items = [
{
text: 'Detail'
},
{
text: 'Send Message'
},
{
text: 'Delete'
}];
var btns = this.element.querySelectorAll('.employee-button');
for (var i = 0; i < btns.length; i++) {
var drpDownBtn = new ejs.splitbuttons.DropDownButton({
items: items,
select: function (e) {
alert(e.item.text)
}
});
drpDownBtn.appendTo(btns[i]);
}
}
});
|