- checkColumn\r
- ]);\r
-\r
- // by default columns are sortable\r
- cm.defaultSortable = true;\r
-\r
- // this could be inline, but we want to define the Plant record\r
- // type so we can add records dynamically\r
- var Plant = Ext.data.Record.create([\r
- // the "name" below matches the tag name to read, except "availDate"\r
- // which is mapped to the tag "availability"\r
- {name: 'common', type: 'string'},\r
- {name: 'botanical', type: 'string'},\r
- {name: 'light'},\r
- {name: 'price', type: 'float'}, // automatic date conversions\r
- {name: 'availDate', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},\r
- {name: 'indoor', type: 'bool'}\r
- ]);\r
+ columns: [\r
+ {\r
+ id: 'common',\r
+ header: 'Common Name',\r
+ dataIndex: 'common',\r
+ width: 220,\r
+ // use shorthand alias defined above\r
+ editor: new fm.TextField({\r
+ allowBlank: false\r
+ })\r
+ }, {\r
+ header: 'Light',\r
+ dataIndex: 'light',\r
+ width: 130,\r
+ editor: new fm.ComboBox({\r
+ typeAhead: true,\r
+ triggerAction: 'all',\r
+ // transform the data already specified in html\r
+ transform: 'light',\r
+ lazyRender: true,\r
+ listClass: 'x-combo-list-small'\r
+ })\r
+ }, {\r
+ header: 'Price',\r
+ dataIndex: 'price',\r
+ width: 70,\r
+ align: 'right',\r
+ renderer: 'usMoney',\r
+ editor: new fm.NumberField({\r
+ allowBlank: false,\r
+ allowNegative: false,\r
+ maxValue: 100000\r
+ })\r
+ }, {\r
+ header: 'Available',\r
+ dataIndex: 'availDate',\r
+ width: 95,\r
+ renderer: formatDate,\r
+ editor: new fm.DateField({\r
+ format: 'm/d/y',\r
+ minValue: '01/01/06',\r
+ disabledDays: [0, 6],\r
+ disabledDaysText: 'Plants are not available on the weekends'\r
+ })\r
+ },\r
+ checkColumn // the plugin instance\r
+ ]\r
+ });\r