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.
I've updated the example (attached) with the excluded code and am still not seeing the error (that I see in production). This leads me to believe it may be an error exclusive to IE, however I cannot confirm this because I cannot get the grid to load in IE11.
Can you see if you can get the attached example running in IE11?
Additionally, after clicking the Undo button, the Redo button has no effect.
Thanks.
Please find answers to your questions below:
1) When I try to run the example in IE11 the grid will not even load AND JavaScript runtime error
IE has issues loading the required IgniteUI javascript files from the CDN, as you have referenced them. Save the files locally and reference them from your local machine and the grid will load fine in IE. I did not experience the JavaScript runtime error, which is most probably also caused by loading from CDN failure.
2) after clicking the Undo button, the Redo button has no effect.
When you use the button to update all cells the setCellValue method is used, so later when you call the OnRedoClick function transaction.type returns "cell". However you were handling only the case when transaction.type = "row", this is wht nothing happens. Youre OnRecoClick function will look this to handle both cell and row edits:
switch (transaction.type) { case "cell": grid.igGridUpdating('setCellValue', transaction.rowId, transaction.col, transaction.value); break;
case "row": grid.igGridUpdating('updateRow', transaction.rowId, transaction.row, null, false); break;}
I have modified the sample following the above mentioned corrections. I have included only the necessary Ignite UI javascript files just to keep the sample small in size and referenced them locally. Please run it in IE 11 and let me know if you still experience issues.
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://es.infragistics.com/support/supported-environments
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.
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,
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.