如題,在建立store時如果要指定其預設的排序欄位(=你對某個欄位按一下排序效果一樣)時,必須在建立此store時加上sortOnLoad,與sorters設定選擇的欄位

ex:

winapp.fileStore = Ext.create('Ext.data.JsonStore', {
pageSize: winapp.GRIDPANEL_PAGESIZE,
remoteSort: true,
fields: [
'text', 'type', 'filesize', 'mt', 'ct', 'at', 'permission', 'owner', 'group', 'folder', 'access', 'path'
],
sortOnLoad: true,
sorters: { property: 'text', direction : 'ASC' },
proxy: {
type: 'ajax',
url: AS.ARC.util.getApiUrlWithSid(winapp.apiUrl, urlOpts),
reader: {
type: 'json',
root: 'datas',
totalProperty: 'All'
}
}

arrow
arrow
    文章標籤
    extjs column sort direction
    全站熱搜

    狼翔月影 發表在 痞客邦 留言(0) 人氣()