Hello Thomas,
such error has typically one from two reasons: 1) you downloaded jqGrid without including “form editing” module (see jqGrid download page) 2) you use wrong order of JavaScript files inserted in the page. To verify the first one probelm you can open jquery.jqGrid.min.js file in the text editor and search in the comment at the beginning of the file for grid.formedit.js after the text “Modules:“. In all cases the error is probably not in the part which you posted, but in for example the HTML code which shown the order of files included.
Best regards
Oleg
Hello Aarati,
if you don't want or don't can implement data sorting on the server you can use loadonce:true. In the case after the data will be loaded the jqGrid change the origival datatype paremeter of jqGrid to 'local'. After that all operations: sorting, paging and filtering/sorting work local. If you need refresh the data you can set datatype
Sorry Tony,
but the line have to be changed one more time (How many errors one can make in one line of code?) from
ts.p.colModel = $.extend({}, ts.p.cmTemplate, ts.p.colModel.template || {}, ts.p.colModel);
to:
ts.p.colModel = $.extend(true, {}, ts.p.cmTemplate, ts.p.colModel.template || {}, ts.p.colModel);
I hope that it is the last my error in the column templates.
Best regards
Oleg
Hello,
I am sure that it is the jqGrid bug. The problem is that in the pager jqGrid use currently non-unique ids like “first”, “prev”, “next” and “last”. I posted here
Hallo Tony,
I though about not yet solved problems which we discussed here and it seems to me I found the solution.
First of all about the problem with the randId function. The current implementation of randId
Hello!
It is not a bug. The problem is that you try to use correspond to my original sugestion and not correspond to its implementation in jqGrid. You should define cmTemplate as the jqGrid parameter and not as the default setting $.jgrid.defaults.cmTemplate. Moreover you want use the setting not for all columns you can use template property of colModel instead.
For example you define
var myGeneralFormOption={ formoptions:{ elmprefix:' ' } }
and then use it in the column where you need it:
{name: "api", index:"api", search:false, hidden:true, template:myGeneralFormOption,
You can use the same operation like if you work with DOM element. You can use jQuery to simplity the code a little. Let us the row of XML data contain subelmenet with the name “UserName”, then you can use
$(rowObject).find('UserName').text()
to get the contain of the subelement.
Best regards
Oleg
Local form editing is not easy but it is possible in the current version of jqGrid (3.8.2). Look at the demo which I recently prepared.
Best regards
Oleg
Starting with the version 3.7 (the current version is 3.8.2) jqGrid have very good support of pure local data inclusive local sorting, paging and filtering/searching. The most easy way to fill gid with data is the usage of data parameter. Look as the demo. One can additionally use for example pure data filtering and have nace effects using jQuery autocomplete or select elements for vary comfortable data analyse: see another demo.
Best regards
Oleg
OK Tony, I see that local sorting is not work correctly. The first problem that I ised parent:”” instead of parent:null, but it is not the only problem.
Nevertherless it seems to me that Tree Grid is very close to support pure local data. Even with the restriction to have no local sorting it could be interestung.
To tell the truth I have almost no expirience in Tree Grid, but I am sure, that you can easy find the palaces in the code which made problems and probably also quickly fix the problem. I find the full support of local data would be fery fine feature of the jqGrid.
Best regards
Oleg
You can for example do following
var mygrid = $('#list');
mygrid.jqGrid({
In you code you call jQuery(“#jqid”).jqGrid('addRowData', i + 1, mydata); out of the
$(function() {/* not here !!!*/});
so you can try to add the data before the page are loaged and before the grid inside of $(function()…) will be created.
In case that you have the grid data in the array (mydata) you can just use data:mydata parameter of jqGrid to fill the grid with data during creating of the grid.
Best regards
Oleg
Probably you should set the datatype to “local”.
You can also use data parameter of jqGrid to create grid having the data. Try data: mydata where var mydata defined as [{id:0, colName:”cel1″}] (here colName should be replace to the name property of the column). If the name of the first colimn is not id, you can add key:true property to the definition of the first column.
If all this should work with tree grid I recommend you to look at the answer which include demos.
Best regards
Oleg
Hello Tony,
I suggest to make small changes in the grid.base.js to allow to use data parameter for jqGrid to fill the Tree Grid. The change is very simple. I suggest to replace the line 1400
Hello Kevin,
please define what do you mean under the DatabaseID and why it is not the same as RowID? With which data you fill the grid? Is user_id is the qnique id for your data? Do you fill the same id in the “id” field attribute of the xml data? If jqGrid find no id information in your input it uses 1,2,3… as ids. Probably it is your problem?
You can additionally define key:true property in the 'user_id' column. I hope this will also fix you problem. Nevertheless I recommend you to read this part of the documentation amd change either you XML data to be readed by jqGrid inclusive ids or include xmlReader parameter which follows to the same results.
Best regards
Oleg
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top