<?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: I add a new row, but nothing happened with the grid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/i-add-a-new-row-but-nothing-happened-with-the-grid</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/i-add-a-new-row-but-nothing-happened-with-the-grid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>chucky2183 on I add a new row, but nothing happened with the grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/i-add-a-new-row-but-nothing-happened-with-the-grid#p25641</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/i-add-a-new-row-but-nothing-happened-with-the-grid#p25641</guid>
        	        	<description><![CDATA[<div id="gt-res-content" class="almost_half_cell">
<div dir="ltr">Hello. I just created a grid of a detail of an invoice and shows it well. I charge<br /> to start a local datatype (i use a local array) because i don&#39;t<br /> touch the database, I just want to be able to insert,<br /> edit and delete rows on the client side. And then when this<br /> ended, newly obtained data and upload it to the database. But by adding<br /> does nothing, call to "someurl.php", but i don&#39;t know what to do with those<br />data to update the data grid.</p>
<p> This is the code</p>
</div>
<p><input type='button' class='sfcodeselect' name='sfselectit9943' value='Select Code' data-codeid='sfcode9943' /></p>
<div class='sfcode' id='sfcode9943'>
<div>&#60;script&#62;<br /> &#160; &#160;var mydata= []; // Empty array because i want to show details of an invoice empty</p>
<p> &#160; &#160;jQuery(&#34;#table&#34;).jqGrid({<br /> &#160; &#160; &#160; &#160;data: mydata,<br /> &#160; &#160; &#160; &#160;datatype: &#39;local&#39;,<br /> &#160; &#160; &#160; &#160;colNames:[&#39;N&#186;&#39;,&#39;Quantity&#39;, &#39;Description&#39;, &#39;Cost&#39;,&#39;SubTotal&#39;],</p>
<div id=&#34;&#34;&#34;:2rd&#34;&#34;&#34;>&#160; &#160; &#160; &#160;colModel:[{name:&#39;number&#39;,width:100, sortable:false,editoptions:{readonly:true,size:10}},<br /> &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;quantity&#39;, width:100,editable:true,sortable:false},<br /> &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;description&#39;, width:400, edittype:&#34;textarea&#34;,align:&#34;right&#34;,editable:true,</div>
<div>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortable:false},<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; {name:&#39;cost&#39;, width:150, align:"right",editable:true,sortable:false,editrules:</div>
<div>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {number:true}},<br /> &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;subtotal&#39;, width:150,editable:true, sortable:false}<br /> &#160; &#160; &#160; &#160;],<br /> &#160; &#160; &#160; &#160;height: &#39;auto&#39;,<br /> &#160; &#160; &#160; &#160;pager: &#39;#pager&#39;,<br /> &#160; &#160;});</p>
<p> &#160; &#160;jQuery("#table").jqGrid(&#39;navGrid&#39;,"#pager",{add:true,edit:true,del:true, search:false, refresh:false},<br /> &#160; &#160; &#160; &#160; &#160; &#160;{height:370,width:400,reloadAfterSubmit:true,url:&#39;someurl.php&#39;}, // edit options<br /> &#160; &#160; &#160; &#160; &#160; &#160;{height:370,width:400,reloadAfterSubmit:true,url:&#39;someurl.php&#39;}, // add options<br /> &#160; &#160; &#160; &#160; &#160; &#160;{reloadAfterSubmit:false,url:&#39;fede.php&#39;} // del options<br /> &#160; &#160; &#160; &#160; &#160; &#160;);<br /> &#60;/script&#62;</p>
</div>
<div><strong>someurl.php</strong> (Here i don&#39;t know how to do to edit the grid) adding, modifying or deleting</div>
<div>&#60;?php<br />if($_POST[oper]==&#39;add&#39;) {<br />&#160;&#160;&#160; $number = $_POST[&#39;number&#39;];<br />&#160;&#160;&#160; $quantity = $_POST[&#39;quantity&#39;];<br />&#160;&#160;&#160; $description = $_POST[&#39;description&#39;];<br />&#160;&#160;&#160; $cost= $_POST[&#39;cost&#39;];<br />&#160;&#160;&#160; $subtotal = $_POST[&#39;subtotal&#39;];<br />&#160;&#160;&#160; $model = array( <br />&#160;&#160;&#160; array("number"=&#62;"$number","quantity"=&#62;"$quantity", <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "description"=&#62;"$description", <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; "cost"=&#62;"$cost", "subtotal"=&#62;$cost* $cantidad));<br />// MODIFIES USER RECORD<br />} elseif($_POST[oper]==&#39;edit&#39;) {<br />&#160;&#160;&#160; $number = $_POST[&#39;number&#39;];<br />&#160;&#160;&#160; $quantity = $_POST[&#39;quantity&#39;];<br />&#160;&#160;&#160; $description = $_POST[&#39;description&#39;];<br />&#160;&#160;&#160; $cost = $_POST[&#39;cost&#39;];<br />&#160;&#160;&#160; $subtotal = $_POST[&#39;subtotal&#39;];<br />} elseif($_POST[oper]==&#39;del&#39;) {<br />&#160;&#160;&#160; $number = $_POST[&#39;number&#39;];<br />&#160;&#160;&#160; $quantity = $_POST[&#39;quantity&#39;];<br />&#160;&#160;&#160; $description = $_POST[&#39;description&#39;];<br />&#160;&#160;&#160; $cost = $_POST[&#39;cost&#39;];<br />&#160;&#160;&#160; $subtotal = $_POST[&#39;subtotal&#39;];<br />&#160;}<br />&#160;return $model;<br />?&#62;</div>
</div>
</div>
</div>
]]></description>
        	        	<pubDate>Wed, 11 Jan 2012 23:22:51 +0200</pubDate>
        </item>
</channel>
</rss>