How can I trigger a common action on a row click action the flexigrid way? I want when the row is clicked to redirect to http://localhost/view/40 (the value of ID) for the clicked row
$("#flex1").flexigrid({
url: 'http://localhost/index.php/get_data',
dataType: 'json',
method: 'GET',
colModel : [
{display: 'ID', name : 'id', width : 40, sortable : true},
{display: 'A', name : 'a', width : 40, sortable : true},
singleSelect {display: 'B', name : 'b', width : 40, sortable : true},
],
sortname: "id",
sortorder: "desc",
showTableToggleBtn: false,
resizable: false,
useRp: true,
rp: 30,
singleSelect: true,
usepager: true,
width: 'auto',
height: 100
});
I’m not sure exactly how flexigrid works, but I use jqGrid, and commonly what I do is to just set these type of actions outside the grid. this does require a common markup naming convention, but I’m assuming flexigrid must do this.
so for example, you can take a look at your HTML in Firebug and see what classes or id might get assigned to the column for ID. maybe its a class like flexigrid-row-id or something like that
just make sure you assign this event after your grid has completed/loaded