<?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: Post with Custom button</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/post-with-custom-button</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/help/post-with-custom-button/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>davidbemenderfer on Post with Custom button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/post-with-custom-button#p11992</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/post-with-custom-button#p11992</guid>
        	        	<description><![CDATA[<p>As usual, I answer my own question.&#160; jQuery has a built in function.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2835' value='Select Code' data-codeid='sfcode2835' /></p>
<div class='sfcode' id='sfcode2835'>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;jQuery.post(<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#39;./JSON/partytime.JSON.Submit.asp&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{ &#39;id&#39;: strLaborID },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;function() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//alert(&#39;Data has been sent to the server.&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;);</p>
</div>
]]></description>
        	        	<pubDate>Mon, 16 Nov 2009 13:09:40 +0200</pubDate>
        </item>
        <item>
        	<title>davidbemenderfer on Post with Custom button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/post-with-custom-button#p11984</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/post-with-custom-button#p11984</guid>
        	        	<description><![CDATA[<p><code></code></p>
<p>&#160;Sorry for so many edits, I had trouble with the formatting.</p>
<p>What is the function jqGrid uses to do the actual POST command?&#160; I&#39;ve been trying to post my data after assembling it without success.</p>
<p>When using FireBug, my POST results are:</p>
<p>Actual: (string)</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3349' value='Select Code' data-codeid='sfcode3349' /></p>
<div class='sfcode' id='sfcode3349'>{&#39;id&#39; = 8}</div>
<p>Desired Post: (objects)</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit190' value='Select Code' data-codeid='sfcode190' /></p>
<div class='sfcode' id='sfcode190'>id&#160; =&#160; 8</div>
<p>What am I doing wrong?&#160; Is there a better built in way?</p>
<p>My data assemby code</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7034' value='Select Code' data-codeid='sfcode7034' /></p>
<div class='sfcode' id='sfcode7034'>$.each(rows,<br />function( intIndex, objValue ){</div>
<p><input type='button' class='sfcodeselect' name='sfselectit5328' value='Select Code' data-codeid='sfcode5328' /></p>
<div class='sfcode' id='sfcode5328'>var rowdata = (jQuery(&#8221;#list&#8221;).getRowData(objValue));<br />if (strLaborID == &#8220;&#8221;) {<br />strLaborID = jQuery(&#8221;#list&#8221;).getCell(objValue,&#8221;labor_id&#8221;);<br />}<br />else<br />{<br />strLaborID = strLaborID + &#8220;,&#8221; + jQuery(&#8221;#list&#8221;).getCell(objValue,&#8221;labor_id&#8221;);<br />}<br />}<br />);</div>
<p><input type='button' class='sfcodeselect' name='sfselectit5118' value='Select Code' data-codeid='sfcode5118' /></p>
<div class='sfcode' id='sfcode5118'>SubmitData(&#8221;POST&#8221;,&#8221;./JSON/partytime.JSON.Submit.asp&#8221;,&#8221;{&#39;id&#39;=&#8221; + strLaborID + &#8220;}&#8221;, &#8220;multipart/form-data&#8221; );</div>
</p>
<p>My SubmitData function (using sarissa.js to define the XMLHttpRequest() object)</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4027' value='Select Code' data-codeid='sfcode4027' /></p>
<div class='sfcode' id='sfcode4027'>function SubmitData(Method,Url,Params,ContentType){<br />&#160;&#160;&#160;&#160;var http =&#160; new XMLHttpRequest();<br />&#160;&#160;&#160;&#160;if (Method == &#39;GET&#39;) {Url = url+&#8221;?&#8221;+Params};</div>
<p><input type='button' class='sfcodeselect' name='sfselectit6561' value='Select Code' data-codeid='sfcode6561' /></p>
<div class='sfcode' id='sfcode6561'>http.open(Method, Url, true);</div>
<p><input type='button' class='sfcodeselect' name='sfselectit7151' value='Select Code' data-codeid='sfcode7151' /></p>
<div class='sfcode' id='sfcode7151'>&#160;&#160;&#160;&#160;if (Method == &#39;POST&#39;) {<br />&#160;&#160;&#160;&#160;&#160;//Send the proper header information along with the request<br />&#160;&#160;&#160;&#160;&#160;http.setRequestHeader(&#8221;Content-type&#8221;, ContentType);<br />&#160;&#160;&#160;&#160;&#160;http.setRequestHeader(&#8221;Content-length&#8221;, Params.length);<br />&#160;&#160;&#160;&#160;&#160;http.setRequestHeader(&#8221;Connection&#8221;, &#8220;close&#8221;);<br />&#160;&#160;&#160;&#160;};</div>
<p><input type='button' class='sfcodeselect' name='sfselectit5189' value='Select Code' data-codeid='sfcode5189' /></p>
<div class='sfcode' id='sfcode5189'>&#160;&#160;&#160;&#160;http.onreadystatechange = function() {//Call a function when the state changes.<br />&#160;&#160;&#160;&#160;&#160;if(http.readyState == 4 &#38;&#38; http.status == 200) {<br />&#160;&#160;&#160;&#160;&#160;&#160;//alert(http.responseText);<br />&#160;&#160;&#160;&#160;&#160;}<br />&#160;&#160;&#160;&#160;};<br />&#160;&#160;&#160;&#160;if (Method == &#39;GET&#39;) {http.send(null)} else {if (Method == &#39;POST&#39;) {http.send(Params)}};<br />&#160;&#160;&#160;&#160;return(http.readyState);</div>
<p><input type='button' class='sfcodeselect' name='sfselectit319' value='Select Code' data-codeid='sfcode319' /></p>
<div class='sfcode' id='sfcode319'>}</div>
<p>&#160;&#160;&#160;&#160;</p>
<p>&#160;&#160;&#160;&#160;</p></p>
]]></description>
        	        	<pubDate>Mon, 16 Nov 2009 11:25:38 +0200</pubDate>
        </item>
</channel>
</rss>