Skip to content

Commit c0ac48a

Browse files
committed
Fix(doco): fix #3509 document sort algorithms being impacted by type
1 parent 6369b0a commit c0ac48a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

misc/tutorial/102_sorting.ngdoc

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ data has changed by calling `gridApi.core.notifyDataChange( uiGridConstants.data
2525
If you set a default sort, you can prevent the user from removing that sort by setting `suppressRemoveSort: true`
2626
for that column. This will let the user change the direction of the sort, but take away the option to remove the sort.
2727

28+
The sort algorithm is chosen based on the column type. ui-grid will guess the type based on the data, although if you load data
29+
asynchronously after the columns it will often decide all your columns are string. You can explicitly set the column type in the
30+
column def using `type='number'`. Valid types are documented in {@link api/ui.grid.class:GridOptions.columnDef columnDef}, and
31+
include `string`, `number`, `numberStr` and `date`. If you use date be aware the code expects a javascript date object.
32+
2833
<example module="app">
2934
<file name="app.js">
3035
var app = angular.module('app', ['ngAnimate', 'ngTouch', 'ui.grid']);

0 commit comments

Comments
 (0)