Opened 12 years ago

Closed 12 years ago

#4899 closed defect (fixed)

Need a test case for custom sorting on the model

Reported by: Bryan Forbes Owned by: sorvell
Priority: high Milestone: 1.1
Component: DojoX Grid Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

I am unable to find a way to define a custom sorting routine for a column. It would be nice if you could do this:

var grid = new Grid({
    model: someModel,
    structure: [
        [[
            { name: "Column 0", sort: someSortFunction }
        ]]
    ]
}, gridDomNode);

This would be especially useful for dates and other data that needs special sort functions.

Change History (3)

comment:1 Changed 12 years ago by sjmiles

Resolution: wontfix
Status: newclosed

By design, sort routines are known only to the data model. Each data field has a 'compare' property which can be customized by data type.

comment:2 Changed 12 years ago by Bryan Forbes

Resolution: wontfix
Status: closedreopened
Summary: Unable to define custom sorting functions for columnsNeed a test case for custom sorting on the model

Although this may be possible, how do you do it? We need a test case for this so we can point people at it when they ask this question (because it will get asked).

comment:3 Changed 12 years ago by sjmiles

Resolution: fixed
Status: reopenedclosed

Sample added in [11458].

Note: See TracTickets for help on using tickets.