Hi Jim!
If you want that somebody help you to find an error in your code, you should post the code. The best is a full code example which reproduce your problem.
Regards
Oleg
If you modify the contain of the jqGrid with respect of
jQuery(“#grid_sched1″).setGridParam({data: myGridData});
you should refresh the internal index used for the local searching with respect of the following line
jQuery(“#grid_sched1″)[0].refreshIndex();
(See
Hi Tony!
I am now back from the vocation and could test the new release of jqGrid with sorttype as function. Thank you very much! It works!
One more information about my original suggestion with the usage of index as a function. It works good with jqGrid 3.7 and 3.7.1, but don't work more on 3.7.2. The function from the index will be forward (in the version 3.7.1) to the expr parameter of getAccessor function. A working example with jqGrid 3.7.1 you can see here http://www.ok-soft-gmbh.com/jqGrid/CustomLocalSort.htm
The solution with sorttype as function I find very good. The most advantage which I see in the place is because sorttype are have sence only with the local data, but index on the other side not only for the local data.
The only restriction of the current implementation of sorttype as function is that it has only one parameter cell (getAccessor function has obj parameter instead), but no other information about the object which are sorted. This chould be not enough for some advance scenarios. So what do you think about the changing of the following lines
ab = $.jgrid.getAccessor(v,by);
if(ab === undefined) { ab = “”; }
ab = findSortKey(ab);
_sortData.push({ 'vSort': ab,'index':i});
to
ab = $.jgrid.getAccessor(v,by);
if(ab === undefined) { ab = “”; }
ab = findSortKey(ab,v);
_sortData.push({ 'vSort': ab,'index':i});
Then findSortKey will have additional second parameter with full row contain (only without current id). Probably id as a third parameter could be also helpful.
What do you think about, Tony?
Best regards
Oleg
Hi cjm19682,
you should use the latest version of jqGrid published on http://github.com/tonytomov/jqGrid/tree/master after the release of 3.7.2. Then you will be able to use sorttype as function.
Best regards
Oleg
I posted the answer on
Sorry Tony, I understand that the current version jqGrid not use formatters for local data. Nevertheless atfer some debugging and examine of code, it seems to me that I do found a solution of the problem which I posted. This is the using of functions as index. The example which I posted seems good working. I asked the question mostly to be sure that the usage of functions as index is and will be a supported feature of jqGrid. It seems to work very good with local data. Please try the code example and say your opinion about. If you like this, it can be an oficial documanted feature of jqGrid and one could use it for any kind of custom sorting of local data.
Thanks
Oleg
Thanks Tony,
I am not yet know new 3.7 features of jqGrid good enough.
Nevertheless, it seems to me that the new function refreshIndex should be at lease documented on /jqgridwiki/doku.php. If would be also nice if the setting of data parameter would be possible with only
Hi!
First of all you should include first grid.locale-en.js and then jquery.jqGrid.min.js.
Second verify that your data has “rows” and so on parts like described in /jqgridwiki/doku.php?id=wiki:retrieving_data#json_dot_notation
First of all you should place grid.locale-en.js before jquery.jqGrid.min.js. If you use 3.7.x version you should better set all data at once instead adding there row after row. See http://stackoverflow.com/questions/3197065/jqgrid-on-clientside-paging-editing-sorting-queries/3197307#3197307 for example.
Moreover you write that you use JSON and WCF, but it you don't use it in the example. I also use jqGrid togeter with WCF. Information from http://stackoverflow.com/questions/2675625/setting-the-content-type-of-requests-performed-by-jquery-jqgrid/2678731#2678731 could be probably helpfull for you.
Best regards
Oleg
Hi!
There are at least two errors in your code. In the code example which define jqGrid you use “#mygrid”, but why you use var mg = $(“#myGrid”); instead of var mg = $(“#mygrid”);?
Next problem: addJSONData is a method of jqGrid and not of the DOM element. So mg[0].addJSONData(arr); should be replaced to mg.addJSONData(arr);
Moreover, if you use 3.7.x version of jqGrid you can use setGridParam to change the value of 'data' parameter. You can read that this way work more quickly: /jqgridwiki/doku.php?id=wiki:options
Regards
Oleg
P.S. Look at http://stackoverflow.com/questions/3197065/jqgrid-on-clientside-paging-editing-sorting-queries/3197307#3197307 in the part UPDATED 3 for the fiexed code which use setGridParam with 'data'.
Sorry, but I don't understand what is yet unclear. If you open jquery.ptTimeSelect.js you can immediately find that ptTimeSelect has defaulf option zIndex: 10. You use currently ptTimeSelect so:
$(el).ptTimeSelect({ containerClass: “timeCntr”, containerWidth: “350px”,
Probably you should use zindex parameter of jQuery.ptTimeSelect with a large enough value.
You can do this with respect of jQuery(“#list”).setCaption('my new caption');
You written that you want to print a grid. Aren't you? If you search for jquery.printElement.js (see http://github.com/erikzaadi/jQueryPlugins/blob/master/jQuery.printElement/jquery.printElement.js) for the text editmod you will find nothing. So there are no conflicts between jquery.printElement.js and jqGrig, form editing. I not really understand why you need use any plugin to print your web page. What you really need is a CSS for the “print” media. It defines which elements and how should be displayed on the print media (what should be printed).
Removing of a a DIV with id = 'editmod' + gridid if you want to print a grid I find absolutely unlogical. It is like a suggestion to break windows if you want to go throuth the door of the hauses. Sorry.
Moreover I recommend you to read http://www.trirand.com/blog/?page_id=393/help/how-to-print-a-jqgrid/#p18449 which it about the same problem.
If you create a jqGrid you define
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top