ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: Digitalsoft on November 02, 2021, 12:25:14 pm

Title: Resetting the History Section When doing vertical scroll down with Pagination
Post by: Digitalsoft on November 02, 2021, 12:25:14 pm
Hi Team,

We are using the tool bar section in the PQ grid and When we have edited the cell value and after applying the vertical scroll bar with pagination, history is resetting so the tool bar section goes to initial state(disabled state). So we couldn't able to see the latest changes in the toolbar . Could you please check the attachment of  NormalCellEdit.jpg and CellEditWithPagination.jpg for you reference. Please assist us to persist the history on pagination.

Reference Link : https://paramquery.com/pro/demos/virtual_scroll

Please add the below snippets in the above reference link and you can see the History Resetting issue.

 history: function (evt, ui) {
              var $tb = this.toolbar();
                if (ui.canUndo != null) {
                  $("button.changes", $tb).button("option", { disabled: !ui.canUndo });
                }
                if (ui.canRedo != null) {
                  $("button:contains('Redo')", $tb).button("option", "disabled", !ui.canRedo);
                }
                $("button:contains('Undo')", $tb).button("option", { label: 'Undo (' + ui.num_undo + ')' });
                $("button:contains('Redo')", $tb).button("option", { label: 'Redo (' + ui.num_redo + ')' });
            },
          toolbar: {
              items: [
                {
                  type: 'button', icon: 'ui-icon-disk', label: 'Save', cls: 'changes', listener: function () {
                    self.saveChanges();
                  },
                  options: { disabled: true }
                },
                {
                  type: 'button', icon: 'ui-icon-cancel', label: 'Reset', cls: 'changes', listener: function () {
                    this.rollback();
                    this.history({ method: 'reset' });
                  },
                  options: { disabled: true }
                },
                { type: 'separator' },
                {
                  type: 'button', icon: 'ui-icon-arrowreturn-1-s', label: 'Undo', cls: 'changes', listener: function () {
                    this.history({ method: 'undo' });
                  },
                  options: { disabled: true }
                },
                {
                  type: 'button', icon: 'ui-icon-arrowrefresh-1-s', label: 'Redo', listener: function () {
                    this.history({ method: 'redo' });
                  },
                  options: { disabled: true }
                },
                {
                  type: "<span class='spanGridStatus'></span>"
                }
              ]
            },


Thanks

Title: Re: Resetting the History Section When doing vertical scroll down with Pagination
Post by: paramvir on November 02, 2021, 05:24:32 pm
History is reset when new remote data is fetched from server.

So if vertical scrollbar causes new remote data to load into grid, history would be reset. Ideally the changes should be saved before fetching new page from server.

Please use large page size to minimize this problem or combine instant saving ( https://paramquery.com/pro/demos/editing_instant ) with lazy loading.
Title: Re: Resetting the History Section When doing vertical scroll down with Pagination
Post by: Digitalsoft on November 03, 2021, 07:11:13 pm
As you said history is resetting and  it is resettting the toolbar section alone but the edited cell is not resetting it is still having the dirty red mark and edited value
Title: Re: Resetting the History Section When doing vertical scroll down with Pagination
Post by: paramvir on November 04, 2021, 09:59:16 am
Please check this example: https://paramquery.com/pro/demos/editing_infinite_scroll

Records are also reset along with history.