////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////


== sortableColumn



=== Purpose


Renders a sortable column to support sorting in tables.


=== Examples


[,xml]
----
<g:sortableColumn property="title" title="Title" />

<g:sortableColumn property="title" title="Title"
                  style="width: 200px" />

<g:sortableColumn property="title" titleKey="book.title" />

<g:sortableColumn property="releaseDate"
                  defaultOrder="desc" title="Release Date" />

<g:sortableColumn property="releaseDate" defaultOrder="desc"
                  title="Release Date" titleKey="book.releaseDate" />
----


=== Description


Either the `title` or `titleKey` attribute is required. `titleKey` takes precedence when both attributes are specified resulting in the title caption being resolved against the message source. In the case when the message can not be resolved, the title is used as the title caption.

Attributes

* `property` - name of the property relating to the field
* `defaultOrder` (optional) - default order for the property; choose between 'asc' (default if not provided) and 'desc'
* `title` (optional) - title caption for the column
* `titleKey` (optional) - title key to use for the column, resolved against the message source
* `params` (optional) - a Map containing request parameters
* `action` (optional) - the name of the action to use in the link; if not specified the `list` action will be used
* `mapping` (optional) - The link:{guidePath}/theWebLayer.html#namedMappings[named URL mapping] to use to rewrite the link

