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?
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.