Forum



11:46

05/11/2010

First of all, thansk for this awesome plugin, really brilliant!
Now, my question… When I look at the examples (http://www.trirand.com/blog/jq.....qgrid.html) and open the first example Loading data, XML data then I see at the bottom left a find and refresh icon.
I do not see that in my grid. I tried activating the navigator but that doesn't help.
Can anyone point me in the right direction how to add these?
18:26

05/11/2010

I too am having problems getting any of the icons to load in the nav bar.
Using Jquery 1.4.3 and jqGrid 3.8.1.
xml data source, using xmlReader to map the fields correctly.
Tried searching forums, and found some examples of how to make it work, but nothing is loading for me regardless of what I try. I have tried loading navGrid via all 3 examples in the documentation (Javescript code, new api code, and chained mode)
.navGrid('#pager_controlsTasks',{ edit: true, add: true, del: true, search: true, refresh: true },
{}//Options for Delete
{},//Options for the Add Dialog
{},//Options for the Edit Dialog
)
All Im really looking for is refresh, but cannot get any to load.
Help? Suggestions?
Thanks
15:50

05/11/2010

17:49

05/11/2010

Here is the HTML code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My First Grid</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/redmond/jquery-ui-1.8.6.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<style>
html, body {
margin: 1em;
padding: 1em;
font-size: 75%;
}
</style>
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-nl.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery().ready(function (){
$("#list1").jqGrid({
url:'jsondump.php',
datatype: 'json',
colNames:['Id','Personeelsnummer','Positie', 'Datum','Gemeente'],
colModel:[
{name:'id', index:'id', width:50, search:false},
{name:'persnr', index:'persnr', width:150 },
{name:'positie', index:'positie', width:100, align:'right'},
{name:'datum', index:'datum', width:100},
{name:'gemeente', index:'gemeente', width:200}
],
mtype: "POST",
pager: '#gridpager',
sortname: 'persnr',
sortorder: 'asc',
caption: 'Wachtlijst',
autowidth: true,
viewrecords: true,
height: "100%"
});
});
jQuery("#list1").jqGrid('navGrid','#gridpager',{edit:false,add:false,del:false});
</script>
</head>
<body>
<table id="list1"></table>
<div id="gridpager"></div>
</body>
</html>
Here is the PHP code of jsondump.php:
<?php
$page = $_REQUEST['page']; // get the requested page
$limit = $_REQUEST['rows']; // get how many rows we want to have into the grid
$sidx = $_REQUEST['sidx']; // get index row - i.e. user click to sort
$sord = $_REQUEST['sord']; // get the direction
if(!$sidx) $sidx = 1;
$totalrows = isset($_REQUEST['totalrows']) ? $_REQUEST['totalrows']: false;
if($totalrows) { $limit = $totalrows; }
$db = mysql_connect('localhost','root','root') or die("Connection Error: " . mysql_error());
mysql_select_db('excel') or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM xxxx_wachtlijst");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
}
else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit * $page - $limit; // do not put $limit*($page - 1)
$sql = "SELECT * FROM xxxx_wachtlijst ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $sql ) or die("Could not execute query.".mysql_error());
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i=0;
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$responce->rows[$i]['id']=$row[id];
$responce->rows[$i]['cell']=array($row[id],$row[persnr],$row[positie],$row[datum],$row[gemeente]);
$i++;
}
echo json_encode($responce);
?>
17:52

Moderators
30/10/2007

Hello,
Please open the jquery.jqGrid.min.js used and post the header info something like this:
/** jqGrid 3.8.1 - jQuery Grid* Copyright (c) 2008, Tony Tomov, mailto:tony@trirand.com* Date:2010-10-24* Modules: grid.base.js;.....;*/
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
17:54

05/11/2010

Here is the header info:
/*
* jqGrid 3.8.1 - jQuery Grid
* Copyright (c) 2008, Tony Tomov, mailto:tony@trirand.com
* http://www.gnu.org/licenses/gpl-2.0.html
* Date:2010-10-24
* Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; jquery.searchFilter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; jqDnR.js; grid.subgrid.js; grid.grouping.js; grid.treegrid.js; grid.import.js; JsonXml.js; grid.setcolumns.js; grid.postext.js; grid.tbltogrid.js; grid.jqueryui.js;
*/
17:57

Moderators
30/10/2007

Hello,
Is this in all browsers?
Try to add DOCTYPE declaration in the file
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
18:00

05/11/2010

18:05

Moderators
30/10/2007

Hello,
Well - sorry that i do not look carfully into the code.
The problem is here:
<script type="text/javascript">
jQuery().ready(function (){
$("#list1″).jqGrid({
....
viewrecords: true,
height: "100%"
});
});
jQuery("#list1″).jqGrid('navGrid','#gridpager',{edit:false,add:false,del:false});
</script>
Should be
<script type="text/javascript">
jQuery().ready(function (){
$("#list1″).jqGrid({
....
viewrecords: true,
height: "100%"
});
jQuery("#list1″).jqGrid('navGrid','#gridpager',{edit:false,add:false,del:false});
});
</script>
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
18:08

05/11/2010

I am really sorry, I now have this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My First Grid</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/redmond/jquery-ui-1.8.6.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<style>
html, body {
margin: 1em;
padding: 1em;
font-size: 75%;
}
</style>
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-nl.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery().ready(function (){
$("#list1").jqGrid({
url:'jsondump.php',
datatype: 'json',
colNames:['Id','Personeelsnummer','Positie', 'Datum','Gemeente'],
colModel:[
{name:'id', index:'id', width:50, search:false},
{name:'persnr', index:'persnr', width:150 },
{name:'positie', index:'positie', width:100, align:'right'},
{name:'datum', index:'datum', width:100},
{name:'gemeente', index:'gemeente', width:200}
],
mtype: "POST",
pager: '#gridpager',
sortname: 'persnr',
sortorder: 'asc',
caption: 'Wachtlijst',
autowidth: true,
viewrecords: true,
height: "100%"
});
jQuery("#list1″).jqGrid('navGrid','#gridpager',{edit:false,add:false,del:false});
});
</script>
</head>
<body>
<table id="list1"></table>
<div id="gridpager"></div>
</body>
</html>
But now I have no grid at all...
18:13

05/11/2010

08:58

25/11/2010

I too having same problem...
My Code is as under. I did tried all but to no success. can tony/anyone help me out
<script type="text/javascript">
$(function(){
$("#list").jqGrid({
url:'viewTask.php',
datatype: 'xml',
colNames:['Task Name','Project Name', 'Assigned By','Assigned To','Phase','Task Created on'],
colModel :[
{name:'fld_name', index:'fld_name', width:90},
{name:'fld_proj_id', index:'fld_proj_id', width:80},
{name:'fld_assigned_by', index:'fld_assigned_by', width:80, align:'right'},
{name:'fld_assigned_to', index:'fld_assigned_to', width:80, align:'right'},
{name:'fld_phase', index:'fld_phase', width:55, align:'right'},
{name:'fld_create_dt', index:'fld_create_dt', width:150, sortable:false}
],
mtype: 'GET',
pager: '#gridpager',
rowNum:10,
rowList:[10,20,30],
sortname: 'fld_name',
sortorder: 'desc',
viewrecords: true,
caption: 'My Task',
height:"100%",
width: 1024,
});
jQuery("#list").jqGrid('navGrid','#gridpager',{edit:false,add:false,del:false});
});
</script>
</head>
<body>
<table id="list"></table>
<div id="gridpager"></div>
Most Users Ever Online: 715
Currently Online:
51 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