So i'm creating a jQwidgets grid view and i'm filling it with some data.
I have a cell which is made as a Button :
{ text: 'Action', datafield: 'Action', width: widthInStr, cellsrenderer: editButtonFunc }
Here is the editButtonFunc :
var editButtonFunc = function(){
return '<input type="button" onClick="showEditInventoryScreenFunction()" class="gridButton" value="Edit/Audit Log"/>';
};
I want when the button is clicked to trigger row selection event to call this function :
showEditInventoryScreenFunction = function(){
$("#jqxgrid").on('rowselect', function (event) {
var row = event.args.rowindex;
var datarow = $("#jqxgrid").jqxGrid('getrowdata', row);
console.log(datarow);
var itemId = datarow.Action;
console.log(itemId);
inventoryController.inventoryEditItems(selector, data1, data2, itemId);
});
};
So now when i click the button nothing happens after that if i select a row or click again the button, then the jqxgrid onclick function is activating.
I want to activate the jqxgrid onclick function when i click the button.
There is a sample with the jQWigets Grid which shows how to handle button clicks. You may look at jQwidgets Grid Popup Editing