Forum
19:55
12/02/2013
Hi..
I'm using Jqgrid Component php on codeigniter using the unformation about "Diferent context"
Loading grid from Ajax. It works but the menubar options (add edit del) dont, just reload…
the example show the way to load the grid..
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#mybutton").click(function(){
jQuery("#mycontent").load("homepage/grid");
return false;
jQuery(this).remove();
});
});
</script>
This is my controller…
public function grid() {
require_once "assets/jqsuite/php/jqGrid.php";
require_once "assets/jqsuite/php/jqGridPdo.php";
$conn = new PDO($this->db->hostname, $this->db->username, $this->db->password);
$conn->query("SET NAMES utf8″);
$grid = new jqGridRender($conn);
$grid->SelectCommand = 'SELECT * FROM menu';
$grid->table = 'menu';
$grid->setPrimaryKeyId('id');
$grid->serialKey = false;
$grid->dataType = 'json';
//set a table to be manipulated
$grid->table = 'menu';
// set the primary key – it is serial
$grid->setPrimaryKeyId('id');
// Let the grid create the model from SQL query
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('homepage/grid');
$grid->setGridOptions(array(
"rownumbers" => true,
"hoverrows" => true,
"rowNum" => 10,
"sortname" => "id",
"rowList" => array(10, 20, 50),
"caption" => "Set Methods Example",
"height" => 210,
));
// Change some property of the field(s)
$grid->setColProperty("id", array("label" => "Menu ID", "width" => 60));
$grid->setColProperty("title", array("label" => "Menu Title", "width" => 60));
$grid->setColProperty("link", array("label" => "Menu Link", "width" => 60));
$grid->setColProperty("parentid", array("label" => "Parentid", "width" => 60));
// Enable navigator
$grid->navigator = true;
// Enjoy
$grid->renderGrid('#grid', '#pager', true, null, null, true, true);
$conn = null;
}
somebody can helpme…
Regars..
Most Users Ever Online: 715
Currently Online:
57 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66