Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
600
"Undo" button resulting in bad date format
posted

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

BadDates.zip
Parents
No Data
Reply
  • 16310
    Offline posted

    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 Anastasov
    Developer Support Engineer
    Infragistics, Inc.

Children