Ext.define('App.store.FileStore', {
	extend: 'Ext.data.Store',

	constructor: function(cfg) {
		var me = this;
		cfg = cfg || {};
		me.callParent([Ext.apply({
			proxy: {
				type: 'ajax',
				url: App.url('/file/list.json'),
				extraParams: cfg.extraParams || {},
				reader: {
					type: 'json',
					rootProperty: 'records',
					idProperty: 'id'
				}
			},
			fields: [
				{
					name: 'id',
					type: 'int',
					allowNull: true
				},
				{
					name: 'skey',
					type: 'string'
				},
				{
					name: 'refType',
					type: 'string'
				},
				{
					name: 'refId',
					type: 'int'
				},
				{
					name: 'filename',
					type: 'string'
				},
				{
					name: 'filesize',
					type: 'int'
				},
				{
					name: 'created',
					type: 'date',
					dateFormat: 'time'
				},
				{
					name: 'createdByName',
					type: 'string'
				},
				{
					name: 'description',
					type: 'string'
				}
			]
		}, cfg)]);
	}
});
