brianm8675309
8 Dec 2009, 4:38 PM
I am using a ListView to display a list of names. The underlying ArrayStore has two columns, name and id.
I would like the ListView to sort by default by the name (it will sort by name if I click the column header). It appears to be sorting by id now.
I have set the SortInfo of the ArrayStore to sort by name, but it is not changing the sort behavior of the ListView.
How can I set a default sort column for the ListView? I don't see a way to do this in the API. Is it possible?
Thanks.
var groupMembersDataStore = new Ext.data.ArrayStore({
url: myUrl,
fields: [ 'id', 'name' ],
sortInfo: {
field: 'name',
direction: 'ASC'
}
});
I would like the ListView to sort by default by the name (it will sort by name if I click the column header). It appears to be sorting by id now.
I have set the SortInfo of the ArrayStore to sort by name, but it is not changing the sort behavior of the ListView.
How can I set a default sort column for the ListView? I don't see a way to do this in the API. Is it possible?
Thanks.
var groupMembersDataStore = new Ext.data.ArrayStore({
url: myUrl,
fields: [ 'id', 'name' ],
sortInfo: {
field: 'name',
direction: 'ASC'
}
});