Here's my question first, followed by explanation:
LABKEY.ext.Store queries the server for your query, and the server returns JSON data with metadata about that table. When I create that store, I want to provide a metadata object. When the server returns the JSON data, I want to merge my custom metadata with that returned by the server.
The purpose of this is to have fine control over the behavior of all things ext. The store and it's metadata is the center of how the components are created, how records created/submitted/validated, etc. If you can get this right, you need a lot less work elsewhere. While some part of this problem would be solved by having the server return more complex metadata, it wont do everything, because sometimes different pages would use the same query and require unique metadata. Further, the really cool things to set would be functions (see Ext.data.Record.convert). The latter can be used to do some cool things like dynamic default values. ie:
"return now()" or "return Ext.get('someField').getValue()"
I think what I need to figure out is the store's reader. There do not seem to be events associated with loading of the server's response. Does anyone (perhaps who wrote LABKEY.ext.Store) have any suggestion or thought into that?
One lesser option would be to just override the default Record type of the store, which gets some of the way there, but is not as good a solution. |