diff --git a/doc/API-mapping.md b/doc/API-mapping.md index 090a760e..9d5fc9fa 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 af4180b3..f25c20bc 100644 --- a/doc/reference/Field.md +++ b/doc/reference/Field.md @@ -5,21 +5,21 @@ A field is the representation of a property of an entity. * [General Field Settings](#general-field-settings) * `string` Field Type * `text` Field Type -* [`wysiwyg` Field Type](#-wysiwyg-field-type) +* [`wysiwyg` Field Type](#wysiwyg-field-type) * `password` Field Type * `email` Field Type -* [`date` Field Type](#-date-field-type) -* [`datetime` Field Type](#-datetime-field-type) -* [`number` Field Type](#-number-field-type) +* [`date` Field Type](#date-field-type) +* [`datetime` Field Type](#datetime-field-type) +* [`number` Field Type](#number-field-type) * `float` Field Type -* [`boolean` Field Type](#-boolean-field-type) -* [`choice` and `choices` Field Types](#-choice-and-choices-field-types) +* [`boolean` Field Type](#boolean-field-type) +* [`choice` and `choices` Field Types](#choice-and-choices-field-types) * `json` Field Type -* [`file` Field Type](#-file-field-type) -* [`reference` Field Type](#-reference-field-type) -* [`referenced_list` Field Type](#-referenced-list-field-type) -* [`embedded_list` Field Type](#-embedded-list-field-type) -* [`reference_many` Field Type](#-reference-many-field-type) +* [`file` Field Type](#file-field-type) +* [`reference` Field Type](#reference-field-type) +* [`referenced_list` Field Type](#referenced-list-field-type) +* [`embedded_list` Field Type](#embedded-list-field-type) +* [`reference_many` Field Type](#reference-many-field-type) ## General Field Settings @@ -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 777f395d..d64fc6d2 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "url": "git://github.com/marmelab/ng-admin.git" }, "devDependencies": { - "admin-config": "^0.11.0", + "admin-config": "^0.11.1", "angular": "~1.4.8", "angular-mocks": "~1.4.8", "angular-numeraljs": "^1.1.6", diff --git a/src/javascripts/ng-admin/Crud/list/maDatagrid.js b/src/javascripts/ng-admin/Crud/list/maDatagrid.js index 6605a796..400b6168 100644 --- a/src/javascripts/ng-admin/Crud/list/maDatagrid.js +++ b/src/javascripts/ng-admin/Crud/list/maDatagrid.js @@ -26,11 +26,14 @@ export default function maDatagrid() { - + {{ field.label() }} + + {{ field.label() }} + Actions