You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+56Lines changed: 56 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -850,6 +850,62 @@ <h1>Sorting tree nodes <small>(order-by, reserve-order)</small></h1>
850
850
</script>
851
851
</section>
852
852
853
+
854
+
<sectionid="filtering" ng-controller="Filtering">
855
+
<divclass="page-header">
856
+
<h1>Filtering tree nodes <small>(filter-expression, filter-comparator)</small></h1>
857
+
</div>
858
+
<divclass="row">
859
+
<divclass="col-md-6 show-grid">
860
+
<divclass="panel panel-default">
861
+
<divclass="panel-body">
862
+
<divclass="example-caption">EXAMPLE:</div>
863
+
<divsave-content="filtering-html">
864
+
<treecontrolclass="tree-classic"
865
+
tree-model="treedata"
866
+
filter-expression="predicate"
867
+
filter-comparator="comparator">
868
+
label: {{node.label}} ({{node.id}})
869
+
</treecontrol>
870
+
</div>
871
+
</div>
872
+
</div>
873
+
</div>
874
+
<divclass="col-md-6">
875
+
<p>The <code>filter-expression</code> and <code>filter-comparator</code> properties allows filtering the nodes of the tree.
876
+
The value of those attributes is used with the <code>ng-repeat</code> Filter filter -
877
+
see more details at the <ahref="https://code.angularjs.org/1.2.25/docs/api/ng/filter/filter">Angular JS Filter</a> docs.</p>
878
+
<p>The filter is done for each branch individually.</p>
879
+
<p>The filter expression (predicate) is used for selecting nodes from the tree to display.
880
+
It can be a string, object or a function. If a string, it is used to match values of the node properties.
881
+
If an object, each property of the expression object is used to match values of the node properties with the same name.
882
+
A function can be used to write arbitrary filters, and will be invoked for each node of the tree.</p>
883
+
<p>The filter comparator is used in determining if the expected value (from the filter expression) and actual value (from the object in the array) should be considered a match.
884
+
If false, it looks for substring match in a case insensitive way (the default).
885
+
If true, it looks for exact match.
886
+
If a function, the function will be given the object value and the predicate value to compare and should return true if the item should be included in filtered result.</p>
0 commit comments