[html-formfu] ExtJS - metaData - Grid population via REST

Benjamin Martin benjamin.martin at ims-evolve.com
Wed Nov 17 16:47:58 GMT 2010


On 17/11/10 15:35, Moritz Onken wrote:
> Is this actually working?

Hi Moritz,

It does work here.

My store looks something like this:

new Ext.data.JsonStore
({
	id:'mystore',
	url: /url/for/rest/api
	remoteSort:true,
	listeners:
	{
		load: function() { this.loadingBox.hide(); },
		beforeLoad: function()
		{
			this.loadingBox = Ext.Msg.wait('Loading');
		},
                 exception: function(d,s,a,o,r)
		{
			this.loadingBox.hide();
			Ext.Msg.show
			({
				title:'Error',
				msg:'Failed to load grid data',
				icon:Ext.MessageBox.ERROR,
				buttons:Ext.Msg.OK
			});
                 },
		metachange:function(store, meta)
		{
			var newColumnModel = new Ext.grid.ColumnModel({columns:meta.fields});
			Ext.getCmp(gridId).reconfigure(store, newColumnModel);
		}
	},
	reader: new Ext.data.ArrayReader
	({
		totalProperty:'total',
		successProperty:'success',
		root:'data'
	})
})


I agree that 'header' is not mentioned as a property of a form.field, 
perhaps because it is not and therefore it is just ignored??

However when the ColumnModel is built using 'meta.fields' 
Ext.grid.ColumnModel does not ignore the property and therefore fills 
out the column headers correctly.




More information about the HTML-FormFu mailing list