ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: EPM Solutions on September 30, 2017, 03:32:14 pm

Title: Reset button deleting last record from grid -need help
Post by: EPM Solutions on September 30, 2017, 03:32:14 pm
Hi Support team,

I am facing the below issue in Paramquery grid -

1. How to stop summary row to edit.
I have added below code on each year column and it's working fine and the same code is not working on text/select column like project

summary: {           type: "all", //use custom aggregate.
                                edit: false
                            }

2. reset button is not working - when I am resetting the grid after any changes it's deleting the last record from grid I have used following code
    grid.rollback();
    grid.history({ method: 'resetUndo' });

3. How can I create delete buttons in each item row row except the summary row.

Please see the attachment for more information.



Title: Re: Reset button deleting last record from grid -need help
Post by: paramvir on October 02, 2017, 10:13:56 am
1. Editability of summary field can be controlled by

groupModel.summaryEdit

https://paramquery.com/pro/api#option-groupModel

and column.summary.edit

https://paramquery.com/pro/api#option-column-summary


2 & 3. grouping is a projection of data in the grid. Batch editing and grouping shouldn't be mixed. So toggle button can be used to turn off grouping when the user wants to make data changes in grid and turned back on when done with changes.
Title: Re: Reset button deleting last record from grid -need help
Post by: EPM Solutions on October 02, 2017, 04:38:48 pm
I have added the summaryEdit:false, in group model but still not working for two select columns .
See the attached screenshot.

Also I don't want to add toggle option is that possible to add delete button only in item row not the summary row.
Title: Re: Reset button deleting last record from grid -need help
Post by: paramvir on October 02, 2017, 10:57:35 pm
The whole summary row can be made uneditable by using editable callback.

Code: [Select]
editable: function(ui){
  return !ui.rowData.pq_gsummary;
}

Similarly delete button can be shown in non-summary rows by using column.render callback.

column.render = function(ui){
  if( !ui.rowData.pq_gsummary ){
    return delete button markup.
  }
}

But as mentioned earlier batch editing and grouping are incompatible and can't be used together.