<?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: Add row and immediately inline edit</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/add-row-and-immediately-inline-edit</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/add-row-and-immediately-inline-edit/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Add row and immediately inline edit</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/add-row-and-immediately-inline-edit#p19175</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/add-row-and-immediately-inline-edit#p19175</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Well I think that this is a copy/paste typo. Try this:</p>
<p>$("#addrow").click( function() {<br /> emptyItem=[{id:"",jobname:"",process:"stopped",disabled:"No",description:"",frequency:"manual",fromemail:"",fromname:"",replyemail:"",subject:"",contenturl:"",restricted:"No",lastrun:"0000-00-00"}];<br /> $("#datagrid").jqGrid(&#39;addRowData&#39;,0,emptyItem);<br /><strong> $("#datagrid").jqGrid(&#39;editRow&#39;, 0,true);</strong><br /> $(this).attr("disabled",true);<br /> $("#editrow").attr("disabled",true);<br /> $("#saverow").attr("disabled",false);<br /> $("#cancel").attr("disabled",false);<br /> });</p>
<p>Kind Regsrds<br />Tony</p>
]]></description>
        	        	<pubDate>Tue, 17 Aug 2010 23:05:25 +0300</pubDate>
        </item>
        <item>
        	<title>JOttinger on Add row and immediately inline edit</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/add-row-and-immediately-inline-edit#p19110</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/add-row-and-immediately-inline-edit#p19110</guid>
        	        	<description><![CDATA[<p>I&#39;m not sure why, in my code below, I can&#39;t get the inline editing of a row to work after I&#39;ve just added it.<br /> &#160;When I click on my #addrow button, a new row is added, but the code to edit that same row doesn&#39;t work.<br /> If I manually select it and edit it, it works.</p>
<p>I&#39;ve been stuck on this issue for a couple days, so any help would be appreciated <img class="wp-smiley" src="/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p><input type='button' class='sfcodeselect' name='sfselectit4377' value='Select Code' data-codeid='sfcode4377' /></p>
<div class='sfcode' id='sfcode4377'>
<pre>$(document).ready(function(){
	var lastsel=0;
	$(&#34;#datagrid&#34;).jqGrid({
		url:&#34;/?mailer/jobsajax&#38;getdata=1&#34;,
		datatype: &#34;json&#34;,
		height: 200,
		width: 680,
		shrinkToFit: false,
	   	colNames:[&#39;ID&#39;,&#39;Job Name&#39;,&#39;Process&#39;,&#39;Disabled&#39;,&#39;Description&#39;, &#39;Frequency&#39;, &#39;From Email&#39;, &#39;From Name&#39;, &#39;Reply Email&#39;, &#39;Subject&#39;, &#39;Content URL&#39;, &#39;Restricted&#39;, &#39;Last Run&#39;],
	   	colModel:[
	   	    {name:&#39;id&#39;, index:&#39;id&#39;, hidden:true},
	   		{name:&#39;jobname&#39;, index:&#39;jobname&#39;, width:200, editable:true, editoptions:{size:&#34;35&#34;,maxlength:&#34;50&#34;}},
	   		{name:&#39;process&#39;, index:&#39;process&#39;, width:80, sortable:true, editable:true, edittype:&#34;select&#34;, editoptions:{value:&#34;start:start;active:active;stopped:stopped&#34;}},	
	   		{name:&#39;disabled&#39;, index:&#39;disabled&#39;, width:60, sortable:true, editable:true, edittype:&#34;checkbox&#34;, editoptions:{value:&#34;Yes:No&#34;}},
	   		{name:&#39;description&#39;, index:&#39;description&#39;, width:250, sortable:true,editable:true, edittype:&#34;textarea&#34;, editoptions:{rows:&#34;2&#34;,cols:&#34;35&#34;}},
	   		{name:&#39;frequency&#39;, index:&#39;frequency&#39;, width:80, sortable:true, editable:true, edittype:&#34;select&#34;, editoptions:{value:&#34;manual:manual;daily:daily;weekly:weekly;biweekly:biweekly;monthly:monthly;annually:annually&#34;}},
	   		{name:&#39;fromemail&#39;, index:&#39;fromemail&#39;, width:150, sortable:true, editable:true, editoptions:{size:&#34;25&#34;,maxlength:&#34;250&#34;}},		
	   		{name:&#39;fromname&#39;, index:&#39;fromname&#39;, width:150, sortable:true, editable:true, editoptions:{size:&#34;25&#34;,maxlength:&#34;250&#34;}},		
	   		{name:&#39;replyemail&#39;, index:&#39;replyemail&#39;, width:150, sortable:true, editable:true, editoptions:{size:&#34;25&#34;,maxlength:&#34;250&#34;}},		
	   		{name:&#39;subject&#39;, index:&#39;subject&#39;, width:150, sortable:true, editable:true, editoptions:{size:&#34;25&#34;,maxlength:&#34;250&#34;}},		
	   		{name:&#39;contenturl&#39;, index:&#39;contenturl&#39;, width:150, sortable:true, editable:true, editoptions:{size:&#34;25&#34;,maxlength:&#34;50&#34;}},
	   		{name:&#39;restricted&#39;, index:&#39;restricted&#39;, width:60, sortable:true, editable:true, edittype:&#34;checkbox&#34;, editoptions:{value:&#34;Yes:No&#34;}},
	   		{name:&#39;lastrun&#39;, index:&#39;lastrun&#39;, width:70, sortable:true, editable:false}	
	   	],
	   	onSelectRow: function(id){
			lastsel=id;
		},
		rowNum:50,
		rowTotal: 2000,
		rowList : [20,30,50],
		loadonce:true,
		mtype: &#34;GET&#34;,
		rownumbers: false,
		rownumWidth: 40,
		gridview: true,
		pager: &#39;#pager&#39;,
		sortname: &#39;id&#39;,
		viewrecords: true,
		sortorder: &#34;desc&#34;, 
		editurl: &#34;/?mailer/jobsajax&#34;,
		caption: &#34;Email Job List&#34;,

	});
	$(&#34;#datagrid&#34;).jqGrid(&#39;filterToolbar&#39;,{stringResult: true,searchOnEnter : false}); 
	$(&#34;#editrow&#34;).click( function() {
		if(lastsel!=0){
			cursel=lastsel
			$(&#34;#datagrid&#34;).jqGrid(&#39;editRow&#39;,cursel);
			$(this).attr(&#34;disabled&#34;,true); 
			$(&#34;#saverow&#34;).attr(&#34;disabled&#34;,false);
			$(&#34;#cancel&#34;).attr(&#34;disabled&#34;,false);
		}
	});
	$(&#34;#saverow&#34;).click( function() {
		$(&#34;#datagrid&#34;).jqGrid(&#39;saveRow&#39;,cursel);
		$(this).attr(&#34;disabled&#34;,true); 
		$(&#34;#editrow&#34;).attr(&#34;disabled&#34;,false); 
		$(&#34;#addrow&#34;).attr(&#34;disabled&#34;,false); 
	});
	$(&#34;#cancel&#34;).click( function() {
		$(&#34;#datagrid&#34;).jqGrid(&#39;restoreRow&#39;,cursel);
		$(this).attr(&#34;disabled&#34;,true); 
		$(&#34;#editrow&#34;).attr(&#34;disabled&#34;,false);
		$(&#34;#addrow&#34;).attr(&#34;disabled&#34;,false); 
	});
	$(&#34;#addrow&#34;).click( function() {
		emptyItem=[{id:&#34;&#34;,jobname:&#34;&#34;,process:&#34;stopped&#34;,disabled:&#34;No&#34;,description:&#34;&#34;,frequency:&#34;manual&#34;,fromemail:&#34;&#34;,fromname:&#34;&#34;,replyemail:&#34;&#34;,subject:&#34;&#34;,contenturl:&#34;&#34;,restricted:&#34;No&#34;,lastrun:&#34;0000-00-00&#34;}];
		$(&#34;#datagrid&#34;).jqGrid(&#39;addRowData&#39;,0,emptyItem);
		$(&#34;#datagrid&#34;).editRow(0,true);
		$(this).attr(&#34;disabled&#34;,true); 
		$(&#34;#editrow&#34;).attr(&#34;disabled&#34;,true); 
		$(&#34;#saverow&#34;).attr(&#34;disabled&#34;,false);
		$(&#34;#cancel&#34;).attr(&#34;disabled&#34;,false);
	});
});</pre>
</div>
]]></description>
        	        	<pubDate>Thu, 12 Aug 2010 21:55:39 +0300</pubDate>
        </item>
</channel>
</rss>