Forum Moderators: open

Message Too Old, No Replies

jquery code help needed

         

ploppy

3:23 pm on May 31, 2010 (gmt 0)

10+ Year Member



hello
this is my first post here, so please excuse me if i waffle on. i would be grateful if someone could look over the posted code and tell me why it is not displaying correctly. the area i need help with is at this part:

caption: 'My first grid'
}).navGrid('#pager', { edit: true, add: true, del: true, search: false, refresh: true },
{},//Options for the Edit Dialog
{},//Options for the Add Dialog
{}//Options for Delete

);

});


The icons appear on the pager but when i click tem they do nothing. also the error message is printing below the pager, which should only appear after clicking the icon such as, add, edit etc. i think it may have something to do with the braces being out of sync. this script is a jqgrd addon to jquery. hope someone can help. many thanks



<!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/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', hidden:true, 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?q=1',
viewrecords: true,
caption: 'My first grid'
}).navGrid('#pager', { edit: true, add: true, del: true, search: false, 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>

daveVk

12:39 am on Jun 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There documentation [trirand.com...] suggests to me

{},//Options for the Edit Dialog

should only be included if edit:false OR no edit:

But that is only my guess.