I wish to use the cellsrender to render my own button using something like the following code:
$("#jqxgrid").jqxGrid(
{
width: 850,
source: dataAdapter,
columnsresize: true,
columns: [
{ text: 'Name', datafield: 'firstname', width: 120 },
{ text: 'Last Name', datafield: 'lastname', width: 120 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', cellsalign: 'right', cellsformat: 'c2' },
{
text: 'Edit', width: 100, height: '100%', datafield: 'Name', columntype: 'button',
cellsrenderer: function (cellvalue, options, rowObject) {
return '<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="">Edit</button>';
},
buttonclick: function (row) {
var data = $('#jqxgrid').jqxGrid('getrowdata', row);
alert(data.firstname);
}
}
]
});
As you can see I am trying to render a button in the cellsrender so that I can make a modal form appear.