// the data store (created below)
var cm = new Roo.grid.ColumnModel([{
header: "Common Name",
- dataIndex: 'common',
+ dataIndex: 'url',
width: 220 /*,
editor: new Ed(new fm.TextField({
// this could be inline, but we want to define the Plant record
// type so we can add records dynamically
- var Plant = Roo.data.Record.create([
- // the "name" below matches the tag name to read, except "availDate"
- // which is mapped to the tag "availability"
- {name: 'common', type: 'string'},
- {name: 'botanical', type: 'string'},
- {name: 'light'},
- {name: 'price', type: 'float'}, // automatic date conversions
- {name: 'availDate', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},
- {name: 'indoor', type: 'bool'}
- ]);
-
+ //
// create the Data Store
var ds = new Roo.data.Store({
// load using HTTP
// the return will be XML, so lets set up a reader
reader: new Roo.data.JsonReader({
- root: 'topics',
+ root: 'images',
totalProperty: 'totalCount',
- id: 'post_id'
+ id: 'id'
}, [
- {name: 'title', mapping: 'topic_title'},
- {name: 'author', mapping: 'author'},
- {name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
- {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},
- {name: 'excerpt', mapping: 'post_text'}
+ {name: 'name', type: 'string'},
+ {name: 'size', type: 'string'},
+ {name: 'lastmod', type: 'string'},
+ {name: 'url', type: 'string'}
])
});
var layout = Roo.BorderLayout.create({
center: {
margins:{left:3,top:3,right:3,bottom:3},
- panels: [new Roo.GridPanel(grid)]
+ panels: [new Roo.panel.Grid(grid)]
}
}, 'grid-panel');
var gridHead = grid.getView().getHeaderPanel(true);
var tb = new Roo.Toolbar(gridHead, [{
- text: 'Add Plant',
+ text: 'Add new',
handler : function(){
Roo.log('clicked');
}