Forum
Topic RSS
00:23
28/10/2009
Offlinehello
i am following the wiki re navigation and the code that i have does not produce any buttons(icons) in the navigation bar(pager). i have attached my code and would be grateful if someone could check and see where i have gone wrong. i am using v3.5.3. many thanks
<html xmlns="http://www.w3.org/1999/xhtml&q.....t;>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jqGrid Demo</title>
<style>
html, body {
margin: 0; /* Remove body margin/padding */
padding: 0;
overflow: auto; /* Remove scroll bars on browser window */
font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
}
</style>
<!-- In head section we should include the style sheet for the grid -->
<link rel="stylesheet" type="text/css" media="screen" href="themes/basic/grid.css" />
<script src="js/jqDnR.js" type="text/javascript"></script>
<script src="js/jqModal.js" type="text/javascript"></script>
<script src="js/grid.common.js" type="text/javascript"></script>
<script src="js/grid.locale-en.js" type="text/javascript"></script>
<script src="js/formatter.js" type="text/javascript"></script>
<script src="js/grid.formedit.js" type="text/javascript"></script>
<script src="js/search2.js" type="text/javascript"></script>
<!-- Of course we should load the jquery library -->
<script src="js/jquery.js" type="text/javascript"></script>
<!-- and at end the jqGrid Java Script file -->
<script src="js/jquery.jqGrid.js" type="text/javascript"></script>
<script type="text/javascript">
// We use a document ready jquery function.
jQuery(document).ready(function(){
jQuery("#list2").jqGrid({
url:'example.php',
datatype: "json",
caption:"JSON Example",
editurl: 'edit.php',
colNames:['Id','Slot', 'Service', 'Activity','User','Item','Filebox'],
colModel:[
{name:'id',index:'id', width:55},
{name:'slot',index:'slot', width:210},
{name:'service',index:'name asc, service', editable:true, width:100},
{name:'activity',index:'activity', width:110, align:"left"},
{name:'user',index:'user', width:80, align:"left"},
{name:'item',index:'item', width:80,align:"left", editable:true},
{name:'filebox',index:'filebox', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager2',
emptyrecords: "Nothing to display",
imgpath: 'themes/basic/images/',
autowidth: true,
height: 'auto',
altRows: true,
sortname: 'id',
autowidth: true,
viewrecords: true,
sortorder: "desc",
pgbuttons: true,
});});
jQuery("#list2").navGrid('#myvalue',
{edit:true,add:true,refresh:true,del:true,search:true
})
.navButtonAdd('#pager2',{
caption:"", buttonicon:"ui-icon-comment", onClickButton:(function() {
jQuery("#list2").setColumns();
return false;
}) ,
position:"last", title: 'Toggle Columns'})
.navButtonAdd('#pager2',{
caption:"", buttonicon:"ui-icon-document", onClickButton: function() {
alert("Please be patient as there may be a lot of files to add."),document.location.href='ExportToExcel.php?e=act';
},
position:"last", title: 'Export to Excel' });
</script>
</head>
<body>
<!-- the grid definition in html is a table tag with class 'scroll' -->
<table id="list2" class="scroll" cellpadding="0" cellspacing="0"></table>
<!-- pager definition. class scroll tels that we want to use the same theme as grid -->
<div id="pager2" class="scroll" style="text-align:center;"></div>
</body>
</html>
Wish i knew more about jqGrid
14:24
Moderators
30/10/2007
OfflineHello,
Please read carfully the installation guide here:
http://www.trirand.com/jqgridw.....to_install
You missed a lot of thisnfgs.
1. You load the old theme CSS file
2. You do not load jQuery UI theme
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:39
28/10/2009
Offlinetony
i have now got a working grid thank you, but the navGrid icons do nothing when i click them and also beneath the pager the text
'Warning no row selected' appears and i haven't selected a row. all i have done is load the grid. what am i doing wrong? i have posted revised code. cheers
<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/ui-lightness/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<style>
html, body {
margin: 0;
padding: 0;
font-size: 75%;
}
</style>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jqDnR.js" type="text/javascript"></script>
<script src="js/jqModal.js" type="text/javascript"></script>
<script src="js/grid.formedit.js" type="text/javascript"></script>
<script src="js/grid.common.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#list").jqGrid({
url:'new.php',
datatype: 'json',
mtype: 'POST',
colNames:['Id','Title', 'Director', 'Year','Bond','Budget'],
colModel :[
{name:'id', index:'id', width:55},
{name:'title', index:'title', width:90},
{name:'director', index:'director', editable:true, width:90},
{name:'year', index:'year', width:80, align:'right'},
{name:'bond', index:'budget', width:80, align:'right'},
{name:'budget', index:'budget', width:80, sortable:false}
],
pager: '#pager',
rowNum:10,
rowList:[10,20,30],
imgpath: 'themes/ui-lightness/images',
sortname: 'id',
autowidth: true,
altRows: true,
sortorder: 'desc',
editurl: 'edit.php',
viewrecords: true,
caption: 'My first grid'
}).navGrid('#pager', { edit: true, add: true, del: true, search: true, refresh: true },
{},//Options for the Edit Dialog
{},//Options for the Add Dialog
{}//Options for Delete
),
});
</script>
</head>
<body>
<table id="list"></table>
<div id="pager"></div>
</body>
</html>
Wish i knew more about jqGrid
21:32
28/10/2009
Offlinehere are 2 examples of what i am referring too.
1) the warning appears whenever i create icon. ie, search:true
2) if i enable say the find with search:true then what you see in image 2 happens. i cannot move forward until i understand why this is happening. i have read over again the docs and wiki and my code is identical. where is it going wrong. many thanks tony.
Wish i knew more about jqGrid
01:23
04/11/2009
OfflineYour load order is all wrong.
Curious, why are you're loading these separately?
<script src="js/jqDnR.js" type="text/javascript"></script>
<script src="js/jqModal.js" type="text/javascript"></script>
<script src="js/grid.formedit.js" type="text/javascript"></script>
<script src="js/grid.common.js" type="text/javascript"></script>
Why are you not including them in the min file build?
If you need to separate them then follow the load order as set in the load file (jquery.jqGrid.js) as found in source from github.
Yours are kinda backwards.
tim
21:39
Moderators
30/10/2007
OfflineHello,
Please follow these instructions
http://www.trirand.com/jqgridw.....to_install
and make diffrence between standart and deveoplment installation
Best Regards
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.
Most Users Ever Online: 994
Currently Online:
16 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
Log In
Home


