Author Topic: Column editable, but some rows not editable  (Read 2530 times)

twz

  • Newbie
  • *
  • Posts: 5
    • View Profile
Column editable, but some rows not editable
« on: May 18, 2014, 05:27:27 am »
I'm building a fairly complex grid where a particular column must be editable, but for some rows should NOT be editable.

At first I used the cellClick event, so when a cell is clicked I could cancel the event if the cell was in a particular row.

This worked well - except the user could still Tab into the cell. I noticed that there's a quitEditMode method, but not a corresponding enterEditMode event - which would be ideal for this purpose.

I solved my problem by hacking the pq core to create an enterEditMode event. Is there a better way to do this? If not, could an enterEditMode event be added to the API?

For anyone interested, this is the code I added to fn._editCell function (after the 3 var declarations):

Code: [Select]
if(this._trigger("enterEditMode", null, {
            rowIndx: rowIndx,
            colIndx: colIndx,
            dataModel: this.options.dataModel
        })===false)
    { return false; }