Hello,
Give a grid a chance to be created first and then restore it. Use setTimeout function for this purpose when you restore the grid:
|
1 2 3 4 5 6 7 |
$(function() { if ($.jgrid.isGridInStorage('onlGrid')) { console.log('loading state after loaded'); setTimeout( function() { $.jgrid.loadState('onlGrid', null, {restoreData: true, compression: true});}, 50); } }); |
Regards,
Will
Guriddo Support Team
Hello,
Thank you for the recommendation. This is true. We will try to fill this gap similar to the navButtonAdd in pager navigator. I will let you know when we have a progress on this feature.
Thank you again.
Kind Regards,
Will
Guriddo Support Team
Hello,
Thank you for posting.
Are you sure that Add-all button does not work? In our demo it is working fine, but when click first Remove all and then Add all, all other clicks to Remove all does not work.
Can you please describe step by step what you do so that the Add all does not work.
Thank you.
Kind Regards,
Will
Guriddo Support Team
Hello,
The date value without separator can’t be accepted in jqGrid except if this is a Unix timestamp.
In order to do what you want you should either create your own custom formatter or provide the date value from the source formatted with separators
Regards,
Will
Guriddo Support Team
Hello,
The problem that you have is that your data has ids = jqg1, jqg2 and etc.These id’s are created by default in jqGrid if the user does not specify it.
In Guriddo jqGrid we have two parameters that control this: guid and uidPref. The default values of these are
|
1 2 3 4 |
guid : 1, uidPref: 'jqg', |
You can change it in way you want.
If the addRowData is used and the id is not set a randId function created a id which is equal uidPref + guid and then increases it.
Please note that these id are created at client side per user. Using this way of setting id and add local data and then save it to the server in multi user environment my cause duplicate values.
Now to answer your question
Is there a way to prevent duplication with automatic numbering?
In your case no. You set ids manually that are used from the grid and then use the automatic ids addition without to increase the counter.
Is it possible to specify the start of row ID numbering
Yes it is possible. You can to set the guid parameter to what number you want this way
|
1 2 |
$.jgrid.guid = 10; ... |
See common functions
If it’s a bug, could you fix it?
I do not think that this is a bug, but a way the grid works.
Speaking strongly you can check for duplicates using your own function.
This function can look like this in your situation:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function CheckDupId( grid_id ) { var grid = $("#"+grid_id); // get the existing data id in grid var grid_ids = grid.jqGrid('getDataIDs'); //check to see if the next id is in grid_ids var next_id = $.jgrid.uidPref + ($.jgrid.guid + 1); if( $.inArray(next_id, grid_ids)>-1 ) { alert("Duplicate id"); } else { alert("No duplicate") } } |
Kind Regards
Will
P.S. Sorry for the mistake in function I have fixed it setting the number in brackets ($.jgrid.guid + 1);
Guriddo Support Team
Hello,
Yes, there is problem to get attributes with hyphen this way. Use function instead.
|
1 2 |
colModel: [ { label: 'Id', name: 'series-id', width: 65, xmlmap: function(obj) {return $(obj).attr('series-id');} }, |
Kind REgards
Will
Guriddo Support Team
Hello,
We have fixed the problem and it will be available in the next release, which is expected next week.
Kind Regards
Will
Guriddo Support Team
Hello Kris,
Thank you for the recommendation.
Actually there is no need to create utility function, since they are available already in jQuery. Instead of this in order to make your coding easy we have created a utility function isJSON – see here
So the idea is to use the jQuery isXMLDoc and isJSON to check if the given rawObject is xml or json. You r code can look like this:
|
1 2 3 4 5 6 7 8 9 |
function showLink(cellvalue,options,rowObject){ if ( $.isXMLDoc( rowObject ) ) { return "<a href="void(0)">" + rowObject.childNodes[7].textContent+ "</a>"; } else if( $.jgrid.isJSON( rowObject ) ) { // your code here } else { return cellvalue; } } |
Kind Regards,
Will
P.S. The code for isJSON function will be available in next release.
Guriddo Support Team
Hello,
You will have the same problem if you use saveRow method. This is a common problem with the custom formatters and editing and I can not recommend acceptable solution for now.
We will replay short with problem.
Kind Regards,
Will
Guriddo Support Team
Hello,
Thank you for the feedback.
We have fixed the problem. It will be available in the next upcoming release and in this case you will not need to rewrite the replace function.
Kind Regards
Will
Guriddo Support Team
Hello,
Thank you for find this.
The current implementation of autocomplete php module with this particular situation is supposed to work only with form editing.
I will let you know when we fix this this problem for inline edit.
Thank you.
Kind Regards,
Will
Guriddo Support Team
Hello,
Thank you for posting this problem.
The reason for this is that the empty string when using on formatter return a ” & #169 ;” which is set in your excel export.
Currently to solve this problem you will need to redefine the replaceStr functiuon in the export options like this
|
1 2 3 4 5 6 7 8 9 10 |
$("#jqGrid").jqGrid("exportToExcel",{ ... replaceStr : function (v) { return v.replace(/</g, '<') .replace(/>/g, '>') .replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, '') .replace("& #160;",""); ... } }); |
The last replace is without space between & and #.
We will try to fix this problem in our next version. We will let you know.
Kind Regards
Will
Guriddo Support Team
Hello,
Thank you for the feedback.
I understand. Hope we will publish the new release at end of April 2021.
In this case you will be notified, since you are a licensed user.
Kind Regards,
Will
Guriddo Support Team
Hello,
Firs of all Thank you for the feedback and we are glad to hear that you have get the latest version.
I will say this is a bug. This bug is currently fixed in our records. Moreover we have created a new option which can disable the empty row.
If you are interested, until you get the official fix, we can send you a link to test the new feature and the fixed bug.
Thank you very much for your patience.
Kind Regards,
Will
Guriddo Support Team
Hello,
At our end this work as expected. Please clear your browser cache.
Note that the no records message currently can’t be disabled programmatically, there is only fix if you add new record.
Regards
Will
Guriddo Support Team
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top