Author Topic: Problem in check box column (insert, update one row, delete multiple rows)  (Read 1646 times)

peterkhoi

  • Pro OEM
  • Newbie
  • *
  • Posts: 1
    • View Profile
Hello PQ team!
I am creating a screen like this example
(https://paramquery.com/pro/demos33/editing)
that has "edit/update, cancel" column. Further more,
I have to add "check box" column at the first column in the grid,
and "delete button" in toolbar so that user can choose multiple rows for deleting.
My problem is... My check box column doesn't work correctly.
Maybe the reason is
            //make rows editable based upon the class.
            editable: function (ui) {
                return this.hasClass({ rowIndx: ui.rowIndx, cls: 'pq-row-edit' });
            }
just one row can be edited (checkbox in that row can be checked) when "edit" button in "edit/update, cancel" column is clicked.
Does anyone know the proper way to do this?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Good question!

Yes the global editable callback is the reason for not allowing checkbox column to work.

You can move the editable callback to columnTemplate and add editable: true to the checkbox column which would fix the problem.

Code: [Select]
columnTemplate: {
//make rows editable based upon the class.
editable: function (ui) {
return this.hasClass({ rowIndx: ui.rowIndx, cls: 'pq-row-edit' });
}
},