<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: JQGrid Save on Control Enter</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on JQGrid Save on Control Enter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31092</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31092</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>The problem is inyour ajaxrowoptions. Try as simple as possible code (do not use any other option) and see where the problem is.</p>
<p>Â </p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Mon, 08 Sep 2014 15:31:06 +0300</pubDate>
        </item>
        <item>
        	<title>lalitmj on JQGrid Save on Control Enter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31050</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31050</guid>
        	        	<description><![CDATA[<p>Thanks Tony,</p>
<p>Another problem which happens when i replace restorerow to saverow that the last row still remains editable so as i keep clicking the rows they all get editable. I just needed one row to be editable at a time.</p>
<p>You help is much appreciated!</p>
]]></description>
        	        	<pubDate>Wed, 03 Sep 2014 07:17:11 +0300</pubDate>
        </item>
        <item>
        	<title>lalitmj on JQGrid Save on Control Enter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31039</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31039</guid>
        	        	<description><![CDATA[<p>Thanks Tony for your help!</p>
]]></description>
        	        	<pubDate>Sat, 30 Aug 2014 01:05:54 +0300</pubDate>
        </item>
        <item>
        	<title>tony on JQGrid Save on Control Enter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31030</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31030</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>As far as I understand the question the enter can not be changed. It can be disabled, but not changed with other key - see docs.</p>
<p>As for the second problem replace restoreRow with save row in onSelect row</p>
<p>Â </p>
<p>if (id &#38;&#38; id !== lastSel) {<br />
 Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â $("#Northwinds").restoreRow(lastSel);</p>
<p>....</p>
<p>Â </p>
<p>to</p>
<div class="sfcode">
<pre class="brush-javascript syntax">if (id &#38;&#38; id !== lastSel) {
 Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â $("#Northwinds").saveRow(lastSel);</pre></div>]]></description>
        	        	<pubDate>Fri, 29 Aug 2014 11:20:56 +0300</pubDate>
        </item>
        <item>
        	<title>lalitmj on JQGrid Save on Control Enter</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31018</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-save-on-control-enter#p31018</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I'm new to JQGrid need help with changing the save option to <strong>control enter</strong> instead of <strong>Enter</strong>. Also my other issue is regarding fetching saved row when i click on another row after edit as it always showing data prior to update (Update is working successfully). I'm attaching code here for reference. Thanks for all your valuable feedback's :-</p>
<p>function buildgrid() {<br />
Â Â  Â Â Â Â  var grid = jQuery("#Northwinds");<br />
Â Â  Â Â Â Â  var gridData;<br />
Â Â  Â Â Â Â  grid.jqGrid({<br />
Â Â  Â Â Â Â Â Â Â Â  url: '/sites/cats/_vti_bin/listdata.svc/TSCMaster',<br />
Â Â  Â Â Â Â Â Â Â Â  datatype: 'json',<br />
Â Â  Â Â Â Â Â Â Â Â  sortable: true,<br />
Â Â  Â Â Â Â Â Â Â Â  rownumbers: false,<br />
Â Â  Â Â Â Â Â Â Â Â  jsonReader: {<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  root: "d.results",<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  repeatitems: false<br />
Â Â  Â Â Â Â Â Â Â Â  },<br />
Â Â Â Â Â  Â Â Â  Â Â Â  Â success: function(data){<br />
Â Â  Â Â Â  Â Â Â  Â var $self = $(this);<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â setTimeout(function () {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â $self.trigger("reloadGrid");<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â }, 50);<br />
Â Â  Â Â Â  Â },<br />
Â Â  Â Â Â  Â afterSubmit: function () {<br />
Â Â  Â Â Â  Â Â Â  Â Â Â  Â $(this).jqGrid("setGridParam", {datatype: 'json'});<br />
Â Â  Â Â Â  Â Â Â  Â Â Â  Â return [true];<br />
Â Â  Â Â Â  Â },<br />
Â Â  Â Â Â Â Â Â Â Â  colNames: [" ", "Script Page", "Scene #", "Item Description", "Comments/Restrictions","url","etag"],<br />
Â Â  Â Â Â Â Â Â Â Â  colModel: [<br />
Â Â  Â Â Â  Â {name: 'myac', width:80, fixed:true, sortable:false, resize:false, formatter:'actions',<br />
Â Â  Â Â Â  Â Â Â  Â formatoptions:{keys:true}},<br />
Â Â  Â Â Â  Â {<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  name: 'ScriptPage',<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  editable: true,<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  sortable: true,<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  index: 'ScriptPage',<br />
Â Â  Â Â Â  Â Â Â Â  search: false,<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  width: 75},<br />
Â Â  Â Â Â Â Â Â Â Â  {<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  name: 'SceneNumber',<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  editable: true,<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  sortable: true,<br />
Â Â  Â Â Â  Â Â Â Â  search: false,<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  index: 'SceneNumber',<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  width: 75},<br />
Â Â  Â Â Â Â Â Â Â Â  {<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  name: 'ItemDescription',<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  editable: true,<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  sortable: true,<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  index: 'ItemDescription',<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â  width: 300},<br />
Â Â  Â Â Â  Â {<br />
Â Â  Â Â Â  Â Â Â Â  name:'CommentsRestrictions',<br />
Â  Â Â  Â Â Â  Â Â Â Â  index:'CommentsRestrictions',<br />
Â Â  Â Â Â  Â Â Â Â  editable:true,<br />
Â Â  Â Â Â  Â Â Â Â  width :600,<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  edittype:'custom',<br />
Â Â  Â Â Â  Â Â Â Â  editoptions:{custom_element:function( value , options) {<br />
Â Â Â Â Â Â  Â Â Â  Â Â Â  Â var elm = $('&#60;textarea rows=4 cols=100&#62;&#60;/textarea&#62;');<br />
Â Â Â Â Â Â  Â Â Â  Â Â Â  Â elm.val( value );<br />
Â Â Â Â Â Â  Â Â Â  Â Â Â  Â // give the editor time to initialize<br />
Â Â Â Â Â Â  Â Â Â  Â Â Â  Â setTimeout( function() {<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â tinymce.init({selector: "textarea#" + options.id<br />
Â Â  Â Â Â  Â Â Â  Â });<br />
Â Â Â Â Â Â  Â Â Â  Â Â Â  Â }, 0);<br />
Â Â Â Â Â Â  Â Â Â  Â Â Â  Â return elm;<br />
Â Â Â Â  Â Â Â  Â Â Â  Â Â Â Â  },<br />
Â Â Â Â  Â Â Â  Â Â Â  Â Â Â Â  custom_value:function( element, oper, gridval) {<br />
Â Â  Â Â Â  Â Â Â Â  var id = element[0].id;<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â Â  if(oper === 'get') {<br />
Â Â  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  return tinymce.get(id).getContent({format: 'row'});<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â Â  } else if( oper === 'set') {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  if(tinymce.get(id)) {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â tinymce.get(id).setContent( gridval );<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â }<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â }<br />
Â Â  Â Â Â  Â Â Â Â Â Â  }<br />
Â Â  Â Â Â  Â Â Â Â  }<br />
Â Â Â Â  Â Â Â  Â Â Â  Â },<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  {Â  Â <br />
Â Â  Â Â Â  Â Â Â Â  name: '__metadata.uri', Â <br />
Â Â  Â Â Â  Â Â Â Â  editable: false,<br />
Â Â  Â Â Â  Â Â Â Â  hidden: true,<br />
Â Â  Â Â Â  Â Â Â Â  width: 400},<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  {Â  Â <br />
Â Â  Â Â Â  Â Â Â Â  name: '__metadata.etag', Â <br />
Â Â  Â Â Â  Â Â Â Â  editable: false,width: 100,<br />
Â Â  Â Â Â  Â Â Â Â  hidden: true}],<br />
Â Â  Â Â Â Â Â Â Â Â  onSelectRow: function(id) {<br />
Â <br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â var rowData = $("#Northwinds").getRowData(id);<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â var newUrl = rowData['__metadata.uri'];<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â $(this).setGridParam({<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â 'editurl': newUrl<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â });<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â if (id &#38;&#38; id !== lastSel) {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â $("#Northwinds").restoreRow(lastSel);<br />
Â <br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â lastSel = id;<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â }<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â $("#Northwinds").editRow(id, true, null, null);<br />
Â Â  Â Â Â  Â <br />
Â Â Â Â Â Â  Â Â Â  Â },<br />
Â Â  Â Â Â  Â <br />
Â Â  Â Â Â  Â serializeRowData: function(postdata) { //USED ON EDIT<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â var x = JSON.stringify(postdata);<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â return x;<br />
Â Â Â Â Â Â  Â Â Â  Â },<br />
Â Â Â Â Â Â  Â Â Â  Â ajaxRowOptions: { // USED ON EDIT<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â contentType: 'application/json; charset=utf-8',<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â datatype: 'json',<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â mtype: 'POST',<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â async: true,<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â beforeSend: function(jqXHR, settings) {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â grid = $("#Northwinds").jqGrid(); // get the selected row<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â this.selectedRow = grid.jqGrid('getGridParam', 'selrow'); // add the selected row to the ajax object so we can get at in in the callback<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â var etag = grid.jqGrid('getCell', this.selectedRow, '__metadata.etag');<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â jqXHR.setRequestHeader("X-HTTP-Method", "MERGE");<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â jqXHR.setRequestHeader("If-Match", etag);<br />
Â <br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â var postdata = $.parseJSON(settings.data);<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â delete postdata['oper']; // dont send operation to the server<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â delete postdata['id']; // dont send operation to the server<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â delete postdata["__metadata.etag"];<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â delete postdata["__metadata.uri"];<br />
Â <br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â settings.data = JSON.stringify(postdata);<br />
Â <br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â }, Â <br />
Â Â  Â Â Â  Â success: function(data, textStatus, jqXHR) {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â // requery the resource to get the new etag // this is due to a bug in ie that drops all headers associated with an h204<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â var selectedRow = this.selectedRow;<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â $.ajax({<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â beforeSend: function(jqXHR, settings) { // need to pass the selectedRow to the second (nested callback)<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â this.selectedRow = selectedRow;<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â },<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â async: false,<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â contentType: 'application/json; charset=utf-8',<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â datatype: 'json',<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â url: this.url,<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â success: function(data, textStatus, jqXHR) {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â var etag = jqXHR.getResponseHeader("ETag");<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â $("#Northwinds").jqGrid("setCell", this.selectedRow, "__metadata.etag", etag); // update the etag on the selected row<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â Â Â  Â }<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â })<br />
Â Â  Â Â Â  Â Â  }<br />
Â Â Â Â Â Â Â Â Â Â  Â Â Â  Â },<br />
Â Â  Â Â Â  Â loadComplete: function (data) {<br />
Â Â Â Â Â Â  Â Â Â  Â Â Â  //setSearchSelect(grid, griddata, 'Category', 'eq');Â Â  Â Â Â Â  Â <br />
Â Â  Â Â Â  Â Â Â  Â },<br />
Â Â  Â Â Â  Â pager: "#pager",Â Â  Â <br />
Â Â  Â Â Â Â Â Â Â Â  rowNum: 1000,<br />
Â Â  Â Â Â  Â rowList: [10, 50, 100, 500, 'All'],<br />
Â Â  Â Â Â  Â height: 'auto',<br />
Â Â  Â Â Â  Â loadonce:true,<br />
Â Â  Â Â Â  Â reloadAfterSubmit: true,<br />
Â Â  Â Â Â  Â viewrecords: true,<br />
Â Â  Â Â Â  Â gridview: true, // insert all the data at once (speedy)<br />
Â Â  Â Â Â  Â caption: 'Theatrical Clearance List'<br />
Â Â  Â Â Â  Â });</p>
]]></description>
        	        	<pubDate>Thu, 28 Aug 2014 01:57:22 +0300</pubDate>
        </item>
</channel>
</rss>