jqGrid: Pass currently selected row parameters
Hi,
How do I pass the currently selected row values (Group, Key, Time, Position) to the editurl (in bold) as a parameter? I have the following code:
- $(document).ready(function() {
- refreshGroups();
- }
- function refreshGroups() {
- $.ajax({
- url: "ajax/refreshGroups",
- dataType: "json",
- success: populateGroups,
- error: handleAjaxError
- });
- }
- function populateGroups(jobs){
- $(function () {
- var grid = $("#list");
- grid.jqGrid({
- datatype: "jsonstring",
- editurl : "ajax/editSelect?Group=",
- datastr: jobs,
- colNames: ["Group", "Key", "Time", "Position", "Enabled"," "],
- colModel: [
- {name: 'tradingBook', index: 'tradingBook', width: 480, sorttype: 'string'},
- {name: 'id', index: 'id', width: 100, sorttype: 'int'},
- {name: 'startTime', index: 'startTime', width: 150, formatter: 'time', sorttype: 'int',editable:true},
- {name: 'queue', index: 'queue', width: 90, formatter: 'int', sorttype: 'number', align: 'center',editable:true},
- {name: 'enbl', index: 'enbl', width: 60, align: 'center',editable:true,edittype:'checkbox',formatter: 'checkbox', editoptions: {value: '1:0'},formatoptions: {disabled: false}},
- {name: 'myac', width:60, fixed:true, sortable:false, resize:false, formatter:'actions',formatoptions:{keys:true}}
- ],
- height: 'auto',
- width: 'auto',
- gridview: true,
- sortable: true,
- treeGrid: true,
- treeGridModel: 'adjacency',
- treedatatype: "GET",
- ExpandColClick: true,
- cellEdit: true,
- jsonReader: {
- repeatitems: false,
- root: function (obj) { return obj; },
- page: function () { return 1; },
- total: function () { return 1; },
- records: function (obj) { return obj.length; }
- }
- });
- });
- }
Note that "ajax/refreshGroups" is a method which retrieves data from a database which is passed into a map and saved in 'jobs'.
I have been stuck with this for days now. I have posted a similar question before with different code, but now I have decided to revert to this code - it might be easier to solve.
Thanks in advance!