Add a non field widget
Closed this issue · 6 comments
dmalisani commented
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
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
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
use ng-if in input tag when row.children is null
dmalisani commented
it works (with row.branch). Thanks a lot!
khan4019 commented
Can you share the changes you made for this? This will help others for similar use case. Some plunker will be awesome
dmalisani commented
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>