diff --git a/doc/API-mapping.md b/doc/API-mapping.md index b2fe1ec6..7eb1bf7c 100644 --- a/doc/API-mapping.md +++ b/doc/API-mapping.md @@ -205,6 +205,8 @@ myApp.config(['RestangularProvider', function(RestangularProvider) { }]); ``` +(If a column is not sortable by your backend, e.g. a computed column, you can disable sorting per-column using [`Field.sortable(false)`](reference/Field.md#general-field-settings).) + ## Filtering All filter fields are added as a serialized object passed as the value of the `_filters` query parameter. For instance, the following `filterView()` configuration: diff --git a/doc/reference/Field.md b/doc/reference/Field.md index 608bb68f..71fc4285 100644 --- a/doc/reference/Field.md +++ b/doc/reference/Field.md @@ -53,7 +53,11 @@ Create a new field of the given type. Default type is 'string', so you can omit Define the label of the field. Defaults to the uppercased field name. * `editable(boolean)` -Define if the field is editable in the edition form. Usefult to display a field without allowing edition (e.g for creation date). +Define if the field is editable in the edition form. Useful to display a field without allowing edition (e.g for creation date). + +* `sortable(boolean)` +Define if the field is sortable in the list view (default `true`). +(See ["Sort Columns and Sort Order"](../API-mapping.md#sort-columns-and-sort-order) for a discussion of how to integrate `ng-admin` sorting with your REST backend.) * `order(number|null)` Define the position of the field in the view. diff --git a/package.json b/package.json index 72c1830e..f6747967 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "lib/" ], "dependencies": { + "admin-config": "~0.12.1", "angular": "~1.4.8", - "admin-config": "0.12.1", "angular-numeraljs": "^1.1.6", "angular-sanitize": "^1.3.15", "angular-translate": "^2.11.0", diff --git a/src/javascripts/ng-admin/Crud/list/maDatagrid.js b/src/javascripts/ng-admin/Crud/list/maDatagrid.js index ff3207b9..58fa37f8 100644 --- a/src/javascripts/ng-admin/Crud/list/maDatagrid.js +++ b/src/javascripts/ng-admin/Crud/list/maDatagrid.js @@ -26,10 +26,13 @@ export default function maDatagrid() { - + {{ field.label() | translate }} + + {{ field.label() | translate }} +