X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/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