Freeze a row from Editing

Freeze a row from Editing

galaxesolutionsgalaxesolutions Posts: 13Questions: 3Answers: 0

I need to prevent a row from inline editing based on a data that is not displayed in grid, but available internally from ajax binding. Meaning some rows will be editable and some rows cannot be editable. The columns has different edit fields like dropdowns, checkbox list, text box etc.

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Are you using a click event handler to call the inline() method? If so, you could put an if condition around that call that would check the hidden data to see if the cell should be editable or not.

    Allan

  • galaxesolutionsgalaxesolutions Posts: 13Questions: 3Answers: 0

    Yes, but I can access the hidden data only by using "full" keyword which is not available in click eventhandler. Is there any method provided by editor/datatable to access the data value for given row regardless of which column is being clicked.

  • galaxesolutionsgalaxesolutions Posts: 13Questions: 3Answers: 0

    I managed to do it as below

    table.row(e.currentTarget._DT_CellIndex.row).data().ColumnName
    
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Yes, you would want to use row().data() to get the data for the current row. Depending on the exact code you are using, table.row( this ).data() is normally much easier than using a private property (the leading underscore indicates that it should be treated as private).

    Allan

  • johnstewart497johnstewart497 Posts: 2Questions: 0Answers: 0

    I hope your recommendation helped galaxesolutions because I too was looking how to solve this problem and your advice helped me. )

This discussion has been closed.