<?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: filter dropdown from another dropdown</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/filter-dropdown-from-another-dropdown</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/filter-dropdown-from-another-dropdown/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on filter dropdown from another dropdown</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/filter-dropdown-from-another-dropdown#p31182</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/filter-dropdown-from-another-dropdown#p31182</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>As far as I understand you try to make depened dropdown in search toolbar.</p>
<p>Using dataUrl is way to build the selects only once when the search toolbar is created.</p>
<p>I think you will need to bind a change event to the first dropdown on which when the values is changed to will the second with the needed values.</p>
<p>You can use dataEvents option to do this - see the docs.</p>
<p>To grab the second select element you should know that the id of this element is a combination of gs_ plusÂ  the column name.</p>
<p>Â </p>
<p>Kind Regards</p>
]]></description>
        	        	<pubDate>Fri, 03 Oct 2014 12:50:39 +0300</pubDate>
        </item>
        <item>
        	<title>wexwell on filter dropdown from another dropdown</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/filter-dropdown-from-another-dropdown#p31149</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/filter-dropdown-from-another-dropdown#p31149</guid>
        	        	<description><![CDATA[<p>bump - I still have not been able to find a working example if anybody has any suggestions.</p>
]]></description>
        	        	<pubDate>Sat, 20 Sep 2014 00:03:59 +0300</pubDate>
        </item>
        <item>
        	<title>wexwell on filter dropdown from another dropdown</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/filter-dropdown-from-another-dropdown#p31101</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/filter-dropdown-from-another-dropdown#p31101</guid>
        	        	<description><![CDATA[<p>I am using the search toolbar and I have all of the features working except I cannot figure out how to pass the values from one dropdown box to the server page to narrow the returned items in the dropdown list.Â  When something has been selected for field I want it to narrow down the list of well names in the other dropdown box to only those available in that field.</p>
<p>I was hoping the post option would be active and pass the field automatically, but of course it could not be that simple. I'm guessing this needs tied to an event but have not been be able to find any examples.</p>
<p>Â </p>
<div class="sfcode">
<pre class="brush-html syntax">Â  Â Â Â Â 
// &#60;![CDATA[

Â Â  Â Â Â  Â jQuery(document).ready(function()
Â Â  Â Â Â  Â { jQuery("#grid").jqGrid({
Â Â  Â Â Â  Â Â Â  Â Â Â  Â url: "getinfo.php",
Â Â  Â Â Â  Â Â Â  Â Â Â  Â datatype: "json",
Â Â  Â Â Â  Â Â Â  Â Â Â  Â mtype: 'POST',
Â Â  Â Â Â  Â Â Â  Â Â Â  Â autowidth: true,
Â Â  Â Â Â  Â Â Â  Â Â Â  Â height: 330,
Â Â  Â Â Â  Â Â Â  Â Â Â  Â colNames: ["Name", "Num", "Field", "Pad", "API", "Legal", "County, State",
Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â "Lease", "Unit CA PA", "Status", "Updated", "Wildlife Stips", "Notes"],
Â Â  Â Â Â  Â Â Â  Â Â Â  Â colModel: [
Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â { name: "well_name", width: 48,sortable: true, search:true, stype:'select', searchoptions: {dataUrl:'selectwell.php'}},
Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â { name: "well_num", width: 18,sortable: true, search:true, stype:'text'},
Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â { name: "field", width: 48,sortable: true, search:true, stype:'select', stype: 'select', searchoptions: {dataUrl:'selectfield.php'}},
Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â { name: "pad", width: 36,sortable: true, stype:'text'},
Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â Â  ...
Â Â  Â Â Â  Â Â Â  Â Â Â  Â ],
Â Â  Â Â Â  Â Â Â  Â Â Â  Â rowNum:10,
Â Â  Â Â Â  Â Â Â  Â Â Â  Â rowList:[10,25,50,10000],
Â Â  Â Â Â  Â Â Â  Â Â Â  Â pager : '#pager',
Â Â  Â Â Â  Â Â Â  Â Â Â  Â sortname: 'field',
Â Â  Â Â Â  Â Â Â  Â Â Â  Â viewrecords: true,
Â Â  Â Â Â  Â Â Â  Â Â Â  Â rownumbers: true,
Â Â  Â Â Â  Â Â Â  Â Â Â  Â gridview: true,
Â Â  Â Â Â  Â Â Â  Â Â Â  Â sortorder: "asc",
Â Â  Â Â Â  Â Â Â  Â Â Â  Â caption:"Master Well List Maintenance"
Â Â  Â Â Â  Â Â Â  Â  });
Â Â  Â Â Â  Â Â Â  Â jQuery("#grid").jqGrid('navGrid','#pager',
Â Â  Â Â Â  Â Â Â  Â { 
Â Â  Â Â Â  Â Â Â  Â Â Â  Â view: true, 
Â Â  Â Â Â  Â Â Â  Â Â Â  Â del: false, 
Â Â  Â Â Â  Â Â Â  Â Â Â  Â add: true, 
Â Â  Â Â Â  Â Â Â  Â Â Â  Â edit: true, 
Â Â  Â Â Â  Â Â Â  Â Â Â  Â search: false,
Â Â  Â Â Â  Â Â Â  Â Â Â  Â refresh: true
Â Â  Â Â Â  Â Â Â  Â },
Â Â  Â Â Â  Â Â Â  Â { /*prmEdit*/ }, 
Â Â  Â Â Â  Â Â Â  Â { /*prmAdd*/ }, 
Â Â  Â Â Â  Â Â Â  Â { /*prmDel*/ } , 
Â Â  Â Â Â  Â Â Â  Â { 
Â Â  Â Â Â  Â Â Â  Â Â Â  Â /*prmSearch*/ 
Â Â  Â Â Â  Â Â Â  Â Â Â  Â multipleSearch:true
Â Â  Â Â Â  Â Â Â  Â }, 
Â Â  Â Â Â  Â Â Â  Â { /*prmView*/ }
Â Â  Â Â Â  Â Â Â  Â );
Â Â  Â Â Â  Â Â Â  Â $('#grid').jqGrid('filterToolbar', { searchOnEnter: true, enableClear: true });
Â Â  Â Â Â  Â Â Â  Â $('#grid').jqGrid('navButtonAdd', '#pager', {
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  caption: "",
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  title: "Toggle Search Toolbar",
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  buttonicon: 'ui-icon-search',
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  onClickButton: function () {
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  this.toggleToolbar();
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  if ($.isFunction(this.p._complete)) {
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  if ($('.ui-search-toolbar', this.grid.hDiv).is(':visible')) 
Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â {
Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â Â Â  Â 
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  $('.ui-search-toolbar', this.grid.fhDiv).show();
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  } else {
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  $('.ui-search-toolbar', this.grid.fhDiv).hide();
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  }
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  this.p._complete.call(this);
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  fixPositionsOfFrozenDivs.call(this);
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  }
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  }
Â Â Â Â Â Â Â Â Â Â Â  });
Â Â  Â Â Â  Â Â Â  Â $('.ui-search-toolbar').hide();
Â Â  Â Â Â  Â });
Â Â Â Â Â Â Â  
// ]]&#62;
</pre></div><p>Â </p>
<p>Server code...</p>
<div class="sfcode">
<pre class="brush-php syntax">&#60;!--?php <br />include("../Includes/aedclass.php"); 
$nconn = new WorkData();
$conn = new PDO ($nconn-&#62;DB_DSN,$nconn-&#62;DB_USER,$nconn-&#62;DB_PASSWORD);

$field = $_POST['field'];

if (strlen($field)&#62;0)
{ $sql = "SELECT field FROM master_well_list WHERE field='$field' GROUP BY field ORDER BY field asc;"; }
else
{ $sql = "SELECT field FROM master_well_list GROUP BY field ORDER BY field asc;"; }

$stmt = $conn-&#62;prepare($sql);
$stmt-&#62;execute();

$response ='';
$response .= '

';
while($row = $stmt-&#62;fetch(PDO::FETCH_NUM)) {
Â Â  Â  $response .= '
'.$row[0].'
';
}
$response .= '';

echo $response;

?&#62;</pre></div>]]></description>
        	        	<pubDate>Tue, 09 Sep 2014 00:13:59 +0300</pubDate>
        </item>
</channel>
</rss>