Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jqGrid: format cell value without changing actual (underlying) value?
- { name: 'Id', index: 'Id', editable: true, hidden: true,
- editoptions: { defaultValue: row_id,
- dataUrl: "DataService.asmx/GetList",
- buildSelect: function (data) {
- var s = '<select>';
- if (data && data.d) {
- //data is nested, so we need a few steps to get to the actual data
- var list = data.d;
- var opts = JSON.parse(list);
- var subList = opts.List;
- //loop through the data to build the options list
- for (var i = 0, l = subList.length; i < l; i++)
- { var ri = subList[i];
- s += '<option value=' + ri.Id + '>' + ri.Name + '</option>';
- }
- }
- else {
- s+= "<option value=0>No data to display</option>";
- }
- return s + "</select>";
- } ,
- dataEvents: [
- { type: 'change',
- fn: function (e) {
- $('input#Id').val(this.value);
- }
- }
- ]
- },
- editrules: {edithidden: true},
- edittype: 'select'
Advertisement
Add Comment
Please, Sign In to add comment