<?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 Populating Text box based on drpdown values?</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-populating-text-box-based-on-drpdown-values</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/jqgrid-populating-text-box-based-on-drpdown-values/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>aamir on JQGRID Populating Text box based on drpdown values?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-populating-text-box-based-on-drpdown-values#p26974</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-populating-text-box-based-on-drpdown-values#p26974</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>First time in this forum....The situation is.. I want to dynamically insert value in the textbox once value is selected/changed in combobox. How can I do this ? I am quite new to JQGrid...</p>
<p>$(document).ready(function(){</p>
</p>
<p>$("#datagrid").jqGrid({</p>
<p>url:&#39;actionpo.php?vid=polpogridjq&#39;,</p>
<p>datatype: &#39;xml&#39;,</p>
<p>mtype: &#39;GET&#39;,</p>
<p>colNames:[&#39;List#&#39;,&#39;PO#&#39;, &#39;Item Code&#39;,&#39;Item Detail&#39;,&#39;Qty&#39;,&#39;Price&#39;,&#39;Tax&#39;],</p>
<p>colModel :[</p>
<p>{name:&#39;polistno&#39;, width:100,editable:true,editable:true,key:true},</p>
<p>{name:&#39;polpono&#39;,index:&#39;polpono&#39;, width:100,editable:true,key: false },</p>
<p>{name:&#39;politemcode&#39;,index:&#39;politemcode&#39;, width:100, align:&#39;right&#39;,sortable:true,editable:true,edittype: "select", editrules: { required: true }, editoptions: { size: 1,</p>
</p>
<p>dataUrl:&#39;actionpo.php?vid=populatesel&#39;,</p>
<p>dataEvents :[</p>
<p>{ type: &#39;change&#39;, fn: function(e) {</p>
<p>var thisval = $(e.target).val();</p>
<p>$.get(&#39;actionpo.php?vid=getitemname&#38;itemcode=&#39;+thisval, function(data)</p>
<p>{ var res = $(data).html();</p>
<p>alert (res)</p>
<p>$(&#39;#politemname&#39;).html(res);</p>
</p>
<p>}); // end get</p>
<p>}//end func</p>
<p>} // end type</p>
<p>] // dataevents</p>
<p>}//edit options</p>
</p>
<p>},</p>
<p>{name:&#39;politemname&#39;,id:"L1", width:300, align:&#39;left&#39;,sortable:false,editable:true},</p>
<p>{name:&#39;politemqty&#39;,width:50, align:&#39;right&#39;,sortable:false,editable:true},</p>
<p>{name:&#39;politemvalue&#39;,  width:80,align:&#39;left&#39;,sortable:false,editable:true},</p>
<p>{name:&#39;politemtax&#39;,  width:50, align:&#39;right&#39;,editable:true}</p>
</p>
<p>],</p>
</p>
<p>pager: $(&#39;#pager&#39;),</p>
<p>rowNum:10,</p>
<p>rowList:[10,20,30],</p>
<p>sortname: &#39;polpono&#39;,</p>
<p>sortorder: &#39;desc&#39;,</p>
<p>shrinkToFit: false,</p>
<p>rownumbers: false,</p>
<p>multiselect: false,</p>
<p>viewRecords: false,</p>
<p>clearAfterAdd:true,</p>
<p>caption: &#39;Itemised Quantity&#39;,</p>
<p>editurl: "actionpo.php?vid=gridformcall",</p>
</p>
<p>}</p>
</p>
<p>).navGrid(&#39;#pager&#39;, { edit: true, add: true, del: true ,search:false, refresh:true},{</p>
<p>//Edit Options</p>
<p>},{ //Add Options</p>
<p>},{</p>
<p>//Delete Options</p>
</p>
<p>width: 350,</p>
<p>caption: &#39;Delete User&#39;,</p>
<p>msg: &#39;Are you sure you want to delete this User?\nThis action is irreversable.&#39; ,</p>
<p>onclickSubmit: function(rp_ge, postdata) {</p>
<p>rp_ge.url = "actionpo.php?vid=gridformcall&#38;delpono=" +</p>
<p>$(&#39;#datagrid&#39;).getCell (postdata, &#39;polpono&#39;);</p>
<p>}</p>
</p>
<p>},</p>
<p>{} //Search options</p>
<p>);</p>
<p>});</p>
</p>
<p>The textbox is "politemname" and dropdown list is "politemcode". combo list is working fine its just I am not able to assign value I receieve from "$.get(&#39;actionpo.php?vid=getitemname&#38;itemcode=&#39;+thisval, function(data) " to text box.</p>
</p>
<p>Also is there a way to get the ids of element(CSS i think) names from modal form in JQgrid ?</p></p>
]]></description>
        	        	<pubDate>Thu, 19 Jul 2012 00:13:16 +0300</pubDate>
        </item>
</channel>
</rss>