I need to download JSON from the server, and I want the user to click and edit the value.
But when they edit, it should not call the server. I mean, I'm not going to update immediately. So I do not want editurl. So I tried 'ClientArray' But still it shows that Url is not set in the warning field. But I need all the edited values, when the user clicks the Add Comments button, this button lights up AddSelectedItemsToSummary () to save them to the server
MVC HTML Script
<div> <table id="persons-summary-grid"></table> <input type="hidden" id="hdn-deptsk" value="2"/> <button id="AddSelectedItems" onclick="AddSelectedItemsToSummary();" /> </div> $(document).ready(function(){ showSummaryGrid();
JSON data
{"total":2,"page":1,"records":2, "rows":[{"PersonSK":1,"Type":"Contract","Attribute":"Organization Activity","Comment":"Good and helping og"}, {"PersonSK":2,"Type":"Permanant","Attribute":"Team Management", "Comment":"Need to improve leadership skill"} ]}
JQGRID Code
var localSummaryArray; function showSummaryGrid(){ var summaryGrid = $("#persons-summary-grid"); // doing this because it is not firing second time using .trigger('reloadGrid') summaryGrid.jqGrid('GridUnload'); var deptSk = $('#hdn-deptsk').val(); summaryGrid.jqGrid({ url: '/dept/GetPersonSummary', datatype: "json", mtype: "POST", postData: { deptSK: deptSk }, colNames: [ 'SK', 'Type', 'Field Name', 'Comments'], colModel: [ { name: 'PersonSK', index: 'PersonSK', hidden: true }, { name: 'Type', index: 'Type', width: 100 }, { name: 'Attribute', index: 'Attribute', width: 150 }, { name: 'Comment', index: 'Comment', editable: true, edittype: 'textarea', width: 200 } ], cellEdit: true, cellsubmit: 'clientArray', editurl: 'clientArray', rowNum: 1000, rowList: [], pgbuttons: false, pgtext: null, viewrecords: false, emptyrecords: "No records to view", gridview: true, caption: 'dept person Summary', height: '250', jsonReader: { repeatitems: false }, loadComplete: function (data) { localSummaryArray= data; summaryGrid.setGridParam({ datatype: 'local' }); summaryGrid.setGridParam({ data: localSummaryArray}); } }); )
Button Press Function
function AddSelectedItemsToSummary() {
Can anyone help with this? why am I getting this url with no error set?
EDIT:
This code works after loadComplete changes. Before it showed the URL Setting Warning