PDA

View Full Version : Sorting parameter



cosw69
15 Aug 2012, 4:57 AM
hi, i want to sort a grid column according to a parameter. Is there a property which i can set it to the parameter i want to sort with. I can do this by overriding getSortParam method in column's view, but i want to set a property instead of overriding a method in view. Any suggestions?

I have:
getSortParam:function(){
retrurn 'fileSize' //i want to sort with file size
}

I want:
someproperty: 'fileSize'

Alternatively,
can i override getSortParam method in controller or model rather than view? I don't want to override it in view, because when i change the design using Ext designer my code in view will be overwritten and gone.

cosw69
15 Aug 2012, 5:46 AM
I found the answer,
You can override a method in controller just like this:

Ext.getCmp(....).getSortParam=function(){

return 'fileSize';
}