X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/direct/direct-grid.js diff --git a/examples/direct/direct-grid.js b/examples/direct/direct-grid.js new file mode 100644 index 00000000..90703fcc --- /dev/null +++ b/examples/direct/direct-grid.js @@ -0,0 +1,48 @@ +Ext.require([ + 'Ext.direct.*', + 'Ext.data.*', + 'Ext.grid.*', + 'Ext.util.Format' +]); + +Ext.define('Company', { + extend: 'Ext.data.Model', + fields: ['name', 'turnover'] +}); + +Ext.onReady(function() { + Ext.direct.Manager.addProvider(Ext.app.REMOTING_API); + + + // create the Tree + Ext.create('Ext.grid.Panel', { + store: { + model: 'Company', + remoteSort: true, + autoLoad: true, + sorters: [{ + property: 'name', + direction: 'ASC' + }], + proxy: { + type: 'direct', + directFn: TestAction.getGrid + } + }, + columns: [{ + dataIndex: 'name', + flex: 1, + text: 'Name' + }, { + dataIndex: 'turnover', + align: 'right', + width: 120, + text: 'Turnover pa.', + renderer: Ext.util.Format.usMoney + }], + height: 350, + width: 600, + title: 'Company Grid', + renderTo: Ext.getBody() + }); +}); \ No newline at end of file