khan4019 / tree-grid-directive

Need one or more maintainer for this! comment or email me if you are interested
http://khan4019.github.io/tree-grid-directive/test/treeGrid.html
347 stars 183 forks source link

Add a non field widget #103

Closed dmalisani closed 8 years ago

dmalisani commented 8 years ago

I need add a checkbox and others widget (buttons, etc) but it should appears only when the branch is expanded. This mean, It must be visible only for each children item. How I can do it?

khan4019 commented 8 years ago

Change the template. Something similar to inside <li ng-repeat

<label>  <input ng-click=\"checkChanged(row)\" type=\"checkbox\" ng-model=\"row.isSelected\">{{ row.label }}</label>
dmalisani commented 8 years ago

yes.. I already tried it but this method it shows in each row, not only in children ---template (partial)----

 <td ng-repeat="col in colDefinitions">
     <div ng-if="col.cellTemplate" compile="col.cellTemplate"></div>
    <div ng-if="!col.cellTemplate">{{row.branch[col.field]}}</div>
         <input ng-click="checkChanged(row)" type="checkbox" ng-model="row.isSelected"></label>
  </td>
khan4019 commented 8 years ago

use ng-if in input tag when row.children is null

dmalisani commented 8 years ago

it works (with row.branch). Thanks a lot!

khan4019 commented 8 years ago

Can you share the changes you made for this? This will help others for similar use case. Some plunker will be awesome

dmalisani commented 8 years ago

The pertinent part in my template is:

<td ng-repeat="col in colDefinitions">
    <div ng-if="col.cellTemplate" compile="col.cellTemplate"></div>
    <div ng-if="!col.cellTemplate">{{row.branch[col.field]}}</div>
             <input ng-if="!row.branch.children.length" ng-click="checkChanged(row)" type="checkbox"    ng-model="row.isSelected"></label>
 </td>