/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * generate a grid, it so commonly used that i decided to make it easy to initiate */ var getNewGrid = function (id, store, columns) { var store = store || new Ext.data.JsonStore({ url: 'get-images.php', root: 'elements', fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}] }); var columns = columns || [ {id: 'name', header: 'Name', sortable: true, dataIndex: 'name'}, {header: 'Modified', width: 120, sortable: true, dataIndex: 'modified'}, {header: 'Type', width: 120, sortable: true, dataIndex: 'type', readOnly: false}, {header: 'Size', width: 120, sortable: true, dataIndex: 'size', align: 'right'} ] return { id : id ,xtype : 'grid' ,store : store ,columns : columns ,autoLoad : false } } // eo function