Hi,
I have a grid with an "Apply Defaults to All" button which updates all of the date and score values for each row in the grid. However when I click the "Undo" button (which reverts the transactions to the previous values) the date values are reverted to a weird format.
E.g.
before: 12/24/1998
after: Thu Dec 24 1998 00:00:00 GMT-0800 (Pacific Standard Time)
Please see attached example.
1) click "Apply Defaults to All" button.
2) click "Undo"
Many Thanks,
Rick
Hello Rick,
This seems like an issue with the date dataType and it only occurs if the cell has been edited programmatically. A possible workaround is to re-render the grid after rolling back the transactions:
function OnUndoClick(e) { updates = $.extend({}, grid.data('igGrid').pendingTransactions()); $.each(updates, function (index, transaction) { grid.igGrid("rollback", transaction.rowId, true); });
columns = $("#grid").igGrid("option", "columns"); $("#grid").igGrid("renderMultiColumnHeader", columns);
....
return false;}
Please let me know if you have further questions on the issue, I will be glad to help.
Best Regards,Hristo AnastasovDeveloper Support EngineerInfragistics, Inc.
Hi Hristo,
Thanks for this. It seems to work fine in the example in Chrome (however in IE11 - our target browser - the grid doesn't even load). When I include the code in my application I get an error:
JavaScript runtime error: cannot call methods on igGridUpdating prior to initialization; attempted to call method 'destroy'.
I can think of two reasons why it may be working in the example and not in my application:
1) The example I provided is a bit stripped down. Some other code elements I excluded for the example may be having an influence.
2) There may be a difference between IE and Chrome.
I will explore #1 and try to create an example that includes more of the "moving parts" that are actually in use on my end to see if that introduces the error. However can you see if you can get the example you provided working in IE11? When I try to run the example in IE11 the grid will not even load and just the buttons appear on the page.
Many Thanks.
1) I found the problem. Try using jquery 1.11.1 and you should see the issue.
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
Can you tell me what are the best versions of jquery for IgniteUI 14.2? Are they the ones you submitted with your example?
2) Works great, thanks!
You're quite right - when using 14.2 it is recommended to reference jQuery 1.11.1 as stated at http://ko.infragistics.com/support/supported-environments
I think there's a bit of confusion here. I am currently referencing jQuery 1.11.1 and that's when the error presents. The files you sent (in which the example works) reference previous versions...
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
If you try your example using 1.11.1 the error should present for you.
So I'm suspecting that I in fact cannot use the latest version of jQuery because of this issue. Can you confirm if this is the case and if you know of the latest version of jQuery I can go with?
Many thanks,
Thank you for your feedback. It seems I misunderstood as if you did not face the issue with 1.11.1. However to make sure we're working on the same path let me know about which issue you mean is working with 1.9.1 and not working in 1.11.1 ? Is it about the date format, because I am facing the date format issue regardless of the jquery and IgniteUI version. (I am working with the last sample attached - Example1_mod.zip)
Please clarify and I will be glad to help you with it.
The date formats are ok. See attached example and follow the steps below to see the current error.
1) Open "Example1 - Broken.html" (which references jQuery 1.11.1) in IE11.
2) Click the "Apply Defaults to All" button.
3) Click the "Undo" button.
This is the error I get:
"JavaScript runtime error: cannot call methods on igGridUpdating prior to initialization; attempted to call method 'destroy'"
However if I reference the older jQuery versions (see "Example1 - Working.html" with the older references) then it works fine.
Thanks,
Hello
I am glad this helped you. I am closing this case since it is answered but please do not hesitate to post here or reopen it if you need any further assistance on the issue.
That seems to work, thank you!
Thank you for clarifying. I was also able to observe the same and would just like to note that it is not a browser specific issue since it occurs in all the major browsers.
However I suggest that we take another and better approach - instead of rerendering the grid on "Undo" button we can just dataBind it:
$("#redo").igButton("option", "disabled", false); $("#undo").igButton("disable"); $("#saveChanges").igButton("disable");
$("#grid").igGrid("dataBind");
Please try it and let me know if you have further questions on that issue.