Making some rows of the treegrid column read only

I have a simple treeGrid, like this:

  1. <b:treeGrid selectMultiple="false" dataSource="myData" width="auto" id="todo_TreeGrid" columnResizing="false">
  2.         <b:treeGridCol select="branchLabel" tree="true" readonly="true"  />
  3.         <b:treeGridCol select="assetLabel" label="Asset"  readonly="true" />
  4.         <b:treeGridCol select="assetType" label="Type"  readonly="true" />
  5.         <b:treeGridCol select="equipmentInfo"           label="Item Info" readonly="true" />
  6.         <b:treeGridCol select="equipmentLocation"       label="Item Location" readonly="true" />
  7.         <b:treeGridCol select="status"                          label="Status" width="100px" >
  8.                 <b:fieldEditor type="application/javascript">
  9.                         <select>
  10.                                 <option value="0">Not Started</option>
  11.                                 <option value="1">Complete</option>
  12.                                 <option value="2">Not Checked</option>
  13.                         </select>
  14.                 </b:fieldEditor>
  15.         </b:treeGridCol>
  16. </b:treeGrid>

Now, I need to disable editing of the last column for rows, which have children (only "leaf rows" will be editable). Expandable rows have no (or I can use empty if that would be useful). Is there any way of making only some rows of the column read only? How to accomplish that?

Hi, you can try the

Hi,
you can try the following to disable editing some of list grid rows. The editing row happens in mousedown event , so the mousedown event has to be changed a bit.You can identified and target the row based on the id in the XML data and manipulate "edit" or "view" list grid's mode property . For instance:

<!-- XML data example-->
<movie id="film-1" parentId="film-0">
                <title>City of God</title>
                <genre>Drama</genre>
                <rating>88</rating>
</movie>

<!-- inside list grid --->
<e:handler event="mousedown" type="application/javascript">
if(event.detail == 2){
if(event.target._._focusedRow=='film-1') // the XML data row has film-1 as an id
this.setProperty('mode','edit');
else
this.setProperty('mode','view');
}
</e:handler>

~Yudi

Thank you, Yudi

Thank you, Yudi. That was very helpful :)