M.D
M.D

Reputation: 237

Extjs custom sorting

I'm having a problem in understanding how I can define my custom sorter function on Grid

I'm using Extjs 6.2.0 (EDIT: see below, at the end of post)

When I try to set up that on store like below:

 sorters: [{
    {
        sorterFn: function() {
            console.log("I'm running from store");
        }
    }
 }]

This runs only once, and actually this makes sense, because documentation says that those are initial sorters

I also tried using that on column

 dataIndex: 'category_name',
 sorter: {
     sorterFn: function() {
         console.log("I'm running from column");
     }
 }

and this function doesnt even run (console.log() not appearing in browser window )

EDIT: It turned out that I'm not using 6.2.0 but 6.0, so sorry for such silly mistake.. Anyways, someone know how I can create custom sort function for column grid in that version ?

Upvotes: 1

Views: 2942

Answers (1)

M.D
M.D

Reputation: 237

Okay eveyrone, I managed to achieve what I wanted with "sortType" custom function defined on field in Model.

Thanks !

Upvotes: 3

Related Questions