The original text is hereArticle date: 2006-9-2
The code is here
The classes contained in DataModel are as follows:
It seems that this is very detailed, so detailed that it seems to be too complicated. But in my opinion, building a solid DataModel is particularly important for improving the reusability and scalability of your code. It is based on this approach that DataModel can be reusable for other components without requiring too many components - although it is huge.
If you open the Js file and observe, you will find that you can set the XMLDataModel in just a few lines of code:
var schema = { tagName: 'Item', id: 'ASIN', fields: ['Author', 'Title', 'Manufacturer', 'ProductGroup'] }; = new (schema);
The actual loaded data:
// The parameter can be url encoed or object typevar params = {'author': author}; //Callback function clear loading('/blog/examples/', params, );
The header can sort the gird. Now do a new search, such as entering John, and the data will still be sorted as you specified after loading. This is a new feature.
In a practical project, we need a convenient exception handling mechanism that can provide callback parameters. LoadableDataModel contains this kind of event (onLoadException).
Overall, everything is going well. Some Part1 feedback tells that Gird works on Safari and other browsers^^. To be honest, some feedback is really good! Thanks!