Forum


19:18

29/03/2011

I've been using jqgrid for a while now, and just recently I've come across this basic problem. I've made a very basic test case that displays a grid with a single column. To invoke the error, click the Add icon to add a record, then hit the Cancel button to get rid of the dialog. Then click the Add icon again, and the dialog does not get displayed a second time, and javascript throws an error, which on firebug says:
fld[0] is undefined on line 6599 of the src version of the jqgrid file (jquery.jqGrid.src.js).
This is such a basic bug that I am trying to figure out what kind of config problem I may be having, but I'm at a loss. I've pared my test case back down to basics and I still have this problem. I am running Firefox 4.01, but have the same problem on IE8 and IE9 on another machine. The test case is at http://www.trubey.net/gsdhja2011/admin/test.html and you can view source to see the basic grid that I made, along with the javascript includes, etc.
The only external initialization the grid does is to request grid rows, and my test php for that is:
echo json_encode( array(
'total' => 1,
'page' => 1,
'records' => 0,
'rows' => array()
)
);
?>
Which returns:
So again, I click the "Add" icon, get a form, cancel out of the form, click the "Add" icon again and javascript throws an error.
And here's the page source:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test</title>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.7.3.custom.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="js/i18n/grid.locale-en.js"></script>
<script type="text/javascript" src="js/jquery.jqGrid.src.js"></script>
<script>
$(function() {
$('#aliasesGrid').jqGrid( {
url: 'getTest.php',
datatype: 'json',
mtype: 'GET',
editurl: 'setTest.php',
colNames: ['aliasID','Alias'],
colModel: [
{ name:'id', index:'id', hidden: true, width: 0 },
{ name:'alias', index:'alias', editable: true }
],
sortname: 'alias',
sortorder: 'asc',
caption: 'Aliases',
pager: '#aliasesNav',
} ).jqGrid('navGrid','#aliasesNav', { } , { } , { } , { } , { } , { } );
} );
</script>
</head>
<body id="body">
<table id="aliasesGrid"></table>
<div id="aliasesNav"></div>
</body>
</html>
19:46

10/08/2009

It is one of the most frequently reported bugs. It is fixed (see here) in the next days after the version 4.0.0 was published. If you use jquery.jqGrid.src.js you can do the same modifications yourself. You can consider to download the latest version of jqGrid from the github.com. In the case you should include every jqGrid module which you use instead of one jquery.jqGrid.src.js file (see here for details).
Best regards
Oleg
19:52

05/05/2011

To fix your existing installation add
recreateForm: true
to add method as described in
http://stackoverflow.com/quest.....ter-cancel
http://stackoverflow.com/quest.....ter-cancel
20:03

29/03/2011

It is a darn good thing message boards don't have audio as everyone would have heard a very loud scream 🙂
Thanks for the quick response, it fixes my issue. Is there any downside to using the latest source files from github as I work through my development? Are there instructions on how to create a minimized version of the code snapshot for when I transition my code to production?
20:30

10/08/2009

It's depend on environment which you use. It you has ant tool, then see here. Other way could be to concatinate all jqGrid modules which you need in one file and run any minification tool (see here), for example YUI Compressor. It is important to hold the order of some jqGrid modules. I recommend you to open jquery.jqGrid.min.js and examin the order of modules in the comment at the beginning of jquery.jqGrid.min.js:
Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; grid.filter.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.tbltogrid.js; grid.jqueryui.js;
If you are sure that you don't need some from the modules you can reduce the list.
I hope that in the short time will be published jqGrid 4.0.1. If it will be before your development will be finished you will need nothing to do.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
160 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