<?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: Menu bar Options  Doesn't Work on diferent Context...</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/menu-bar-options-doesnt-work-on-diferent-context</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/discussion/menu-bar-options-doesnt-work-on-diferent-context/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>fvasquez on Menu bar Options  Doesn't Work on diferent Context...</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/menu-bar-options-doesnt-work-on-diferent-context#p28258</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/menu-bar-options-doesnt-work-on-diferent-context#p28258</guid>
        	        	<description><![CDATA[<p>Hi..</p>
<p>I&#39;m using Jqgrid Component php on codeigniter using the unformation about "Diferent context"</p>
<p>Loading grid from Ajax. It works but the menubar options&#160; (add edit del) dont, just reload&#8230;</p>
<p>the example show the way to load the grid..</p>
<p>&#60;script type="text/javascript"&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(document).ready(function() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#mybutton").click(function(){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#mycontent").load("homepage/grid");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return false;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(this).remove();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/script&#62;</p>
</p>
<p>This is my controller&#8230;</p>
<p>&#160;&#160; public function grid() {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; require_once "assets/jqsuite/php/jqGrid.php";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; require_once "assets/jqsuite/php/jqGridPdo.php";</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conn = new PDO($this-&#62;db-&#62;hostname, $this-&#62;db-&#62;username, $this-&#62;db-&#62;password);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conn-&#62;query("SET NAMES utf8&#8243;);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid = new jqGridRender($conn);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;SelectCommand = &#39;SELECT * FROM menu&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;table = &#39;menu&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;setPrimaryKeyId(&#39;id&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;serialKey = false;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;dataType = &#39;json&#39;;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; //set a table to be manipulated<br />$grid-&#62;table = &#39;menu&#39;;<br />// set the primary key &#8211; it is serial<br />$grid-&#62;setPrimaryKeyId(&#39;id&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Let the grid create the model from SQL query<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;setColModel();</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Set the url from where we obtain the data<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;setUrl(&#39;homepage/grid&#39;);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;setGridOptions(array(<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "rownumbers" =&#62; true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "hoverrows" =&#62; true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "rowNum" =&#62; 10,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "sortname" =&#62; "id",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "rowList" =&#62; array(10, 20, 50),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "caption" =&#62; "Set Methods Example",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "height" =&#62; 210,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ));</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Change some property of the field(s)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;setColProperty("id", array("label" =&#62; "Menu ID", "width" =&#62; 60));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;setColProperty("title", array("label" =&#62; "Menu Title", "width" =&#62; 60));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;setColProperty("link", array("label" =&#62; "Menu Link", "width" =&#62; 60));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;setColProperty("parentid", array("label" =&#62; "Parentid", "width" =&#62; 60));</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Enable navigator<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;navigator = true;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Enjoy<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $grid-&#62;renderGrid(&#39;#grid&#39;, &#39;#pager&#39;, true, null, null, true, true);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conn = null;<br />&#160;&#160;&#160; }</p>
</p>
<p>somebody can helpme&#8230;</p>
</p>
<p>Regars..</p></p>
]]></description>
        	        	<pubDate>Tue, 12 Feb 2013 19:55:22 +0200</pubDate>
        </item>
</channel>
</rss>