Created
December 12, 2011 01:33
-
-
Save sakunyo/1464097 to your computer and use it in GitHub Desktop.
Ext GridTable で Blankを常に下へ表示
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.override(Ext.util.Sorter, { | |
defaultSorterFn: function( o1, o2 ) { | |
var me = this, | |
transform = me.transform, | |
v1 = me.getRoot(o1)[me.property], | |
v2 = me.getRoot(o2)[me.property]; | |
if (transform) { | |
v1 = transform(v1); | |
v2 = transform(v2); | |
} | |
if (v1 == '' && v2 == ''){ | |
return 0; | |
} | |
if (v1 === ''){ | |
return me.direction == 'ASC' ? 1 : -1; | |
} | |
if (v2 === ''){ | |
return me.direction == 'ASC' ? -1 : 1; | |
} | |
return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment