<?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: Support addRowData in edit mode</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/support-addrowdata-in-edit-mode</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/feature-request/support-addrowdata-in-edit-mode/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>clintp on Support addRowData in edit mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/support-addrowdata-in-edit-mode#p27081</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/support-addrowdata-in-edit-mode#p27081</guid>
        	        	<description><![CDATA[<p>Why not just call "saveRow", get the values, and then "editRow"?</p></p>
]]></description>
        	        	<pubDate>Mon, 06 Aug 2012 19:43:27 +0300</pubDate>
        </item>
        <item>
        	<title>benayun on Support addRowData in edit mode</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/support-addrowdata-in-edit-mode#p27071</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/support-addrowdata-in-edit-mode#p27071</guid>
        	        	<description><![CDATA[<p>Right now, when you call getRowData in edit mode, you get the html source of the elements, instead of getting the row values.</p>
<p>I wrote a method that returns the actual values, that calls "getRowDataFromEditMode". You should paste it in jquery.jqGrid.src.js.</p>
<p>getRowDataFromEditMode: function(rowid) {</p>
<p>var success = false;</p>
<p>var $t = this[0], nm, tmp = {}, tmp2 = {}, tmp3 = {}, editable, fr, cv, ind;</p>
<p>if (!$t.grid) { return success; }</p>
<p>ind = $($t).jqGrid("getInd", rowid, true);</p>
<p>if (ind === false) { return success; }</p>
<p>editable = $(ind).attr("editable");</p>
<p>if (editable === "1") {</p>
<p>var cm;</p>
<p>$(&#39;td[role="gridcell"]&#39;, ind).each(function(i) {</p>
<p>cm = $t.p.colModel[i];</p>
<p>nm = cm.name;</p>
<p>if (nm != &#39;cb&#39; &#38;&#38; nm != &#39;subgrid&#39; &#38;&#38; cm.editable === true &#38;&#38; nm != &#39;rn&#39; &#38;&#38; !$(this).hasClass(&#39;not-editable-cell&#39;)) {</p>
<p>switch (cm.edittype) {</p>
<p>case "checkbox":</p>
<p>var cbv = ["Yes", "No"];</p>
<p>if (cm.editoptions) {</p>
<p>cbv = cm.editoptions.value.split(":");</p>
<p>}</p>
<p>tmp[nm] = $("input", this).is(":checked") ? cbv[0] : cbv[1];</p>
<p>break;</p>
<p>case &#39;text&#39;:</p>
<p>case &#39;password&#39;:</p>
<p>case &#39;textarea&#39;:</p>
<p>case "button":</p>
<p>tmp[nm] = $("input, textarea", this).val();</p>
<p>break;</p>
<p>case &#39;select&#39;:</p>
<p>if (!cm.editoptions.multiple) {</p>
<p>tmp[nm] = $("select option:selected", this).val();</p>
<p>tmp2[nm] = $("select option:selected", this).text();</p>
<p>} else {</p>
<p>var sel = $("select", this), selectedText = [];</p>
<p>tmp[nm] = $(sel).val();</p>
<p>if (tmp[nm]) { tmp[nm] = tmp[nm].join(","); } else { tmp[nm] = ""; }</p>
<p>$("select option:selected", this).each(</p>
<p>function(i, selected) {</p>
<p>selectedText[i] = $(selected).text();</p>
<p>}</p>
<p>);</p>
<p>tmp2[nm] = selectedText.join(",");</p>
<p>}</p>
<p>if (cm.formatter &#38;&#38; cm.formatter == &#39;select&#39;) { tmp2 = {}; }</p>
<p>break;</p>
<p>case &#39;custom&#39;:</p>
<p>try {</p>
<p>if (cm.editoptions &#38;&#38; $.isFunction(cm.editoptions.custom_value)) {</p>
<p>tmp[nm] = cm.editoptions.custom_value.call($t, $(".customelement", this), &#39;get&#39;);</p>
<p>if (tmp[nm] === undefined) { throw "e2"; }</p>
<p>} else { throw "e1"; }</p>
<p>} catch (e) {</p>
<p>if (e == "e1") { $.jgrid.info_dialog($.jgrid.errors.errcap, "function &#39;custom_value&#39; " + $.jgrid.edit.msg.nodefined, $.jgrid.edit.bClose); }</p>
<p>if (e == "e2") { $.jgrid.info_dialog($.jgrid.errors.errcap, "function &#39;custom_value&#39; " + $.jgrid.edit.msg.novalue, $.jgrid.edit.bClose); }</p>
<p>else { $.jgrid.info_dialog($.jgrid.errors.errcap, e.message, $.jgrid.edit.bClose); }</p>
<p>}</p>
<p>break;</p>
<p>}</p>
<p>cv = $.jgrid.checkValues(tmp[nm], i, $t);</p>
<p>if (cv[0] === false) {</p>
<p>cv[1] = tmp[nm] + " " + cv[1];</p>
<p>return false;</p>
<p>}</p>
<p>if ($t.p.autoencode) { tmp[nm] = $.jgrid.htmlEncode(tmp[nm]); }</p>
</p>
<p>}</p>
<p>});</p>
</p>
<p>}</p>
<p>return tmp;</p>
<p>}</p>
]]></description>
        	        	<pubDate>Sun, 05 Aug 2012 17:30:59 +0300</pubDate>
        </item>
</channel>
</rss>