Author Topic: disable/enable row/cell dynamically after grid is created  (Read 1561 times)

angelahlp

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
disable/enable row/cell dynamically after grid is created
« on: January 02, 2021, 02:59:01 am »
I need to dynamically disable a row or cell based on the recId. The recId is being sent from an outside source and the related row/cell needs to be disabled/enabled accordingly.

Can you tell me how to accomplish that. I saw the "editable" "option" and demo, but can't seem to get it to work.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: disable/enable row/cell dynamically after grid is created
« Reply #1 on: January 04, 2021, 02:49:16 pm »
Conditional editability for rows / cells can be obtained with editable callback.

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

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

Code: [Select]
editable: function(ui){
  if(ui.rowData.recId == 'some value' ){
    return true or false;
  }
}