Return to Snippet

Revision: 9570
at November 12, 2008 14:42 by peteinlux


Initial Code
/**
 * 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

Initial URL


Initial Description


Initial Title
EXTJS - basic grid blueprint

Initial Tags
textmate

Initial Language
Other