Author Topic: disable row edting  (Read 3185 times)

chirag

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 27
    • View Profile
disable row edting
« on: June 29, 2018, 10:44:42 am »
How to disable particular row for editing?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: disable row edting
« Reply #1 on: June 29, 2018, 11:02:51 am »
Rows can be enabled/ disabled for editing based on any run time condition by using editable callback

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

chirag

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: disable row edting
« Reply #2 on: August 08, 2018, 12:10:45 pm »
I achieved conditional row editing by editable callback. But is there any way to make exception for one column.
I want one column always editable.
Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: disable row edting
« Reply #3 on: August 08, 2018, 01:18:05 pm »
Add editable: true to the exception column.

and move editable callback to columnTemplate

Code: [Select]
columnTemplate: {
    editable: function (ui){

    }
}

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

chirag

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: disable row edting
« Reply #4 on: August 08, 2018, 02:10:16 pm »
That's not work for me. I have conditions for each column for editable purpose. That will overwrite by column template. Please find screenshot.
Row with blue color are non editable but in that "Plan'18" column should be editable always.
Column with "ACT" header is always non editable at the same time and column with "LTF" header is in editable mode.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: disable row edting
« Reply #5 on: August 09, 2018, 10:32:45 am »
column.editable callback gets both row and column based parameters.

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

so move all your conditional row and columns based editable logic in a single editable callback and add it to columnTemplate.

Code: [Select]
columnTemplate: {
    editable: function (ui){
        //use row based conditions with ui.rowIndx or rowData.
        //and use column based conditions with ui.dataIndx 
    }
}
« Last Edit: August 09, 2018, 10:35:43 am by paramquery »