sort the datagrid

 

 

 

sortable property is set to true will be able to see the sign

 

Property Name Property Value Type description Defaults
sortable boolean If true, it allows sorting of columns. undefined
order string The default sort order number, only 'asc' or 'desc'.
(This property is available from version 1.3.2 to start)
undefined

 

 

Event name parameter description
onSortColumn sort, order When a user sort of trigger, parameters include:
the Sort: Sort the column field name.
order: sequential ordering of columns (ASC or DESC)

When loading datagrid

$('#topic_report_grid').datagrid({
        url : url,
        queryParams : {
            publicityType : publicityType,
        },
        
        sortName : 'id',
        sortOrder : 'desc',
        toolbar : '#toolbar',
        
        onSortColumn : function(sort, order) {
            // 排序
        },

Background reception

 

 

 

<!-- 分页排序支持: -->
    <sql id="query_Page_order_by">
        <if test="sort != null  and order != null">
            order by ${sort} ${order}
        </if>
    </sql>

 

 

Guess you like

Origin www.cnblogs.com/lvhouhou/p/11991767.html
Recommended