Author Topic: Editable Row  (Read 2904 times)

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Editable Row
« on: April 15, 2016, 09:47:11 pm »
I have a table for creating and editing company stocked parts which has the PartNumber column set to 'editable: false' in the ColModel.

When the "New Part" toolbar button is clicked I use the 'grid.editCell' method to override editing and allow the user to type a new PartNumber...so normally users cannot change PartNumber, whereas they can change other existing Part parameters.

If they navigate away from PartNumber to complete remaining data entries they cannot then return to the PartNumber (in case of mistake) because the PartNumber is returned to default state of non editable. 

I can see ways to change editable state of the whole column, which I don't want to do because I don't want existing PartNumbers changed.  Is there a method to make a whole row, or specific cells, editable even after adjacent cells have been clicked/edited in the meantime?

(Currently still using version 3.2)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Editable Row
« Reply #1 on: April 18, 2016, 10:53:53 am »
1) column.editable can also be a callback function in which edit ability of a field can be decided based on any arbitrary run time condition.

http://paramquery.com/pro/api32#option-column-editable

Example: http://paramquery.com/pro/demos32/readonly_cells

2) Edit ability of a whole row can be based on run time condition with help of editable callback

http://paramquery.com/pro/api32#option-editable

Example: http://paramquery.com/pro/demos32/editing
« Last Edit: April 18, 2016, 01:07:52 pm by paramquery »