kovtik
11-03-2006, 04:54 PM
It will be great to provide a capability to set sort type functions for every data model column in the data schema (like it was previously in the column schema), like this:
var dataSchema = {
tagName: 'child',
fields: ['name', 'date', 'size'],
sortTypes: [ , parseDate, parseInt]
}
var dataModel = new YAHOO.ext.grid.XMLDataModel(dataSchema);
I think also that
DefaultDataModel.sort(sortInfo, columnIndex, direction, suppressEvent)
function can be replaced by
DefaultDataModel.sort(sortInfo, dataColumnIndex, direction, suppressEvent)
This will provide a capability to sort all data columns and makes data model more independent, so it can be used only to load, parse and sort xml data, for example.
DefaultDataModel.setDefaultSort(sortInfo, columnIndex, direction) function can be moved into DefaultColumnModel class because it sets default sorting for only rendered columns.
I hope you understand my idea to separate data from view as much as possible.
var dataSchema = {
tagName: 'child',
fields: ['name', 'date', 'size'],
sortTypes: [ , parseDate, parseInt]
}
var dataModel = new YAHOO.ext.grid.XMLDataModel(dataSchema);
I think also that
DefaultDataModel.sort(sortInfo, columnIndex, direction, suppressEvent)
function can be replaced by
DefaultDataModel.sort(sortInfo, dataColumnIndex, direction, suppressEvent)
This will provide a capability to sort all data columns and makes data model more independent, so it can be used only to load, parse and sort xml data, for example.
DefaultDataModel.setDefaultSort(sortInfo, columnIndex, direction) function can be moved into DefaultColumnModel class because it sets default sorting for only rendered columns.
I hope you understand my idea to separate data from view as much as possible.