|
9 | 9 | algorithms</p>
|
10 | 10 | </div></div>
|
11 | 11 | <div class="member method"><h2 id="methods">Methods</h2>
|
12 |
| -<ul class="methods"><li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L103" class="view-source icon-eye-open"> </a><h3 id="methods_basicsort">basicSort(a, b)</h3> |
| 12 | +<ul class="methods"><li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L92" class="view-source icon-eye-open"> </a><h3 id="methods_basicsort">basicSort(a, b)</h3> |
13 | 13 | <div class="basicsort"><div class="basicsort-page"><p>Sorts any values that provide the < method, including strings
|
14 | 14 | or numbers. Handles nulls and undefined through calling handleNulls</p>
|
15 | 15 | </div><h5 id="methods_basicsort_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>a</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="basicsort-page"><p>sort value a</p>
|
16 | 16 | </div></td></tr><tr><td>b</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="basicsort-page"><p>sort value b</p>
|
17 | 17 | </div></td></tr></tbody></table><h5 id="methods_basicsort_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-number">number</a></td><td><div class="basicsort-page"><p>normal sort function, returns -ve, 0, +ve</p>
|
18 | 18 | </div></td></tr></table></div>
|
19 | 19 | </li>
|
20 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L293" class="view-source icon-eye-open"> </a><h3 id="methods_getsortfn">getSortFn(grid, col, rows)</h3> |
| 20 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L251" class="view-source icon-eye-open"> </a><h3 id="methods_getsortfn">getSortFn(grid, col, rows)</h3> |
21 | 21 | <div class="getsortfn"><div class="getsortfn-page"><p>Get the sort function for the column. Looks first in
|
22 | 22 | rowSorter.colSortFnCache using the column name, failing that it
|
23 | 23 | looks at col.sortingAlgorithm (and puts it in the cache), failing that
|
|
34 | 34 | </div></td></tr></tbody></table><h5 id="methods_getsortfn_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-function">function</a></td><td><div class="getsortfn-page"><p>the sort function chosen for the column</p>
|
35 | 35 | </div></td></tr></table></div>
|
36 | 36 | </li>
|
37 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L42" class="view-source icon-eye-open"> </a><h3 id="methods_guesssortfn">guessSortFn(itemType)</h3> |
| 37 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L32" class="view-source icon-eye-open"> </a><h3 id="methods_guesssortfn">guessSortFn(itemType)</h3> |
38 | 38 | <div class="guesssortfn"><div class="guesssortfn-page"><p>Assigns a sort function to use based on the itemType in the column</p>
|
39 | 39 | </div><h5 id="methods_guesssortfn_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>itemType</td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="guesssortfn-page"><p>one of 'number', 'boolean', 'string', 'date', 'object'. And
|
40 | 40 | error will be thrown for any other type.</p>
|
41 | 41 | </div></td></tr></tbody></table><h5 id="methods_guesssortfn_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-function">function</a></td><td><div class="guesssortfn-page"><p>a sort function that will sort that type</p>
|
42 | 42 | </div></td></tr></table></div>
|
43 | 43 | </li>
|
44 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L75" class="view-source icon-eye-open"> </a><h3 id="methods_handlenulls">handleNulls(a, b)</h3> |
| 44 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L65" class="view-source icon-eye-open"> </a><h3 id="methods_handlenulls">handleNulls(a, b)</h3> |
45 | 45 | <div class="handlenulls"><div class="handlenulls-page"><p>Sorts nulls and undefined to the bottom (top when
|
46 | 46 | descending). Called by each of the internal sorters before
|
47 | 47 | attempting to sort. Note that this method is available on the core api
|
|
52 | 52 | a sort value that should be passed back from the sort function</p>
|
53 | 53 | </div></td></tr></table></div>
|
54 | 54 | </li>
|
55 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L344" class="view-source icon-eye-open"> </a><h3 id="methods_prioritysort">prioritySort(a, b)</h3> |
| 55 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L295" class="view-source icon-eye-open"> </a><h3 id="methods_prioritysort">prioritySort(a, b)</h3> |
56 | 56 | <div class="prioritysort"><div class="prioritysort-page"><p>Used where multiple columns are present in the sort criteria,
|
57 | 57 | we determine which column should take precedence in the sort by sorting
|
58 | 58 | the columns based on their sort.priority</p>
|
|
61 | 61 | </div></td></tr></tbody></table><h5 id="methods_prioritysort_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-number">number</a></td><td><div class="prioritysort-page"><p>normal sort function, returns -ve, 0, +ve</p>
|
62 | 62 | </div></td></tr></table></div>
|
63 | 63 | </li>
|
64 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L396" class="view-source icon-eye-open"> </a><h3 id="methods_sort">sort(grid, rows, columns)</h3> |
| 64 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L343" class="view-source icon-eye-open"> </a><h3 id="methods_sort">sort(grid, rows, columns)</h3> |
65 | 65 | <div class="sort"><div class="sort-page"><p>sorts the grid</p>
|
66 | 66 | </div><h5 id="methods_sort_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>grid</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="sort-page"><p>the grid itself</p>
|
67 | 67 | </div></td></tr><tr><td>rows</td><td><a href="" class="label type-hint type-hint-array">array</a></td><td><div class="sort-page"><p>the rows to be sorted</p>
|
|
70 | 70 | </div></td></tr></tbody></table><h5 id="methods_sort_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-array">array</a></td><td><div class="sort-page"><p>sorted rows</p>
|
71 | 71 | </div></td></tr></table></div>
|
72 | 72 | </li>
|
73 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L201" class="view-source icon-eye-open"> </a><h3 id="methods_sortalpha">sortAlpha(a, b)</h3> |
| 73 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L173" class="view-source icon-eye-open"> </a><h3 id="methods_sortalpha">sortAlpha(a, b)</h3> |
74 | 74 | <div class="sortalpha"><div class="sortalpha-page"><p>Sorts string values. Handles nulls and undefined through calling handleNulls</p>
|
75 | 75 | </div><h5 id="methods_sortalpha_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>a</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortalpha-page"><p>sort value a</p>
|
76 | 76 | </div></td></tr><tr><td>b</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortalpha-page"><p>sort value b</p>
|
77 | 77 | </div></td></tr></tbody></table><h5 id="methods_sortalpha_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-number">number</a></td><td><div class="sortalpha-page"><p>normal sort function, returns -ve, 0, +ve</p>
|
78 | 78 | </div></td></tr></table></div>
|
79 | 79 | </li>
|
80 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L253" class="view-source icon-eye-open"> </a><h3 id="methods_sortbool">sortBool(a, b)</h3> |
| 80 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L217" class="view-source icon-eye-open"> </a><h3 id="methods_sortbool">sortBool(a, b)</h3> |
81 | 81 | <div class="sortbool"><div class="sortbool-page"><p>Sorts boolean values, true is considered larger than false.
|
82 | 82 | Handles nulls and undefined through calling handleNulls</p>
|
83 | 83 | </div><h5 id="methods_sortbool_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>a</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortbool-page"><p>sort value a</p>
|
84 | 84 | </div></td></tr><tr><td>b</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortbool-page"><p>sort value b</p>
|
85 | 85 | </div></td></tr></tbody></table><h5 id="methods_sortbool_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-number">number</a></td><td><div class="sortbool-page"><p>normal sort function, returns -ve, 0, +ve</p>
|
86 | 86 | </div></td></tr></table></div>
|
87 | 87 | </li>
|
88 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L224" class="view-source icon-eye-open"> </a><h3 id="methods_sortdate">sortDate(a, b)</h3> |
| 88 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L195" class="view-source icon-eye-open"> </a><h3 id="methods_sortdate">sortDate(a, b)</h3> |
89 | 89 | <div class="sortdate"><div class="sortdate-page"><p>Sorts date values. Handles nulls and undefined through calling handleNulls.
|
90 | 90 | Handles date strings by converting to Date object if not already an instance of Date</p>
|
91 | 91 | </div><h5 id="methods_sortdate_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>a</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortdate-page"><p>sort value a</p>
|
92 | 92 | </div></td></tr><tr><td>b</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortdate-page"><p>sort value b</p>
|
93 | 93 | </div></td></tr></tbody></table><h5 id="methods_sortdate_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-number">number</a></td><td><div class="sortdate-page"><p>normal sort function, returns -ve, 0, +ve</p>
|
94 | 94 | </div></td></tr></table></div>
|
95 | 95 | </li>
|
96 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L128" class="view-source icon-eye-open"> </a><h3 id="methods_sortnumber">sortNumber(a, b)</h3> |
| 96 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L118" class="view-source icon-eye-open"> </a><h3 id="methods_sortnumber">sortNumber(a, b)</h3> |
97 | 97 | <div class="sortnumber"><div class="sortnumber-page"><p>Sorts numerical values. Handles nulls and undefined through calling handleNulls</p>
|
98 | 98 | </div><h5 id="methods_sortnumber_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>a</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortnumber-page"><p>sort value a</p>
|
99 | 99 | </div></td></tr><tr><td>b</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortnumber-page"><p>sort value b</p>
|
100 | 100 | </div></td></tr></tbody></table><h5 id="methods_sortnumber_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-number">number</a></td><td><div class="sortnumber-page"><p>normal sort function, returns -ve, 0, +ve</p>
|
101 | 101 | </div></td></tr></table></div>
|
102 | 102 | </li>
|
103 |
| -<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L148" class="view-source icon-eye-open"> </a><h3 id="methods_sortnumberstr">sortNumberStr(a, b)</h3> |
| 103 | +<li><a href="https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/services/rowSorter.js#L142" class="view-source icon-eye-open"> </a><h3 id="methods_sortnumberstr">sortNumberStr(a, b)</h3> |
104 | 104 | <div class="sortnumberstr"><div class="sortnumberstr-page"><p>Sorts numerical values that are stored in a string (i.e. parses them to numbers first).
|
105 | 105 | Handles nulls and undefined through calling handleNulls</p>
|
106 | 106 | </div><h5 id="methods_sortnumberstr_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>a</td><td><a href="" class="label type-hint type-hint-object">object</a></td><td><div class="sortnumberstr-page"><p>sort value a</p>
|
|
0 commit comments