制作可刷新的side bar rest wcf 数据源(sencha2.0项目)
发布时间:2020-12-15 01:05:49 所属栏目:百科 来源:网络整理
导读:Ext.application({ name: 'Sencha',launch: function () { var tpl = new Ext.XTemplate( 'tpl class="contact2"{MetricName}/tpl/brtpl class="contact2"{HostName}/tpltpl if="StatusId 1"img style="float:right;padding-right:50px" src="/image/notific
Ext.application({ name: 'Sencha',launch: function () { var tpl = new Ext.XTemplate( '<tpl class="contact2">{MetricName}</tpl></br><tpl class="contact2">{HostName}</tpl><tpl if="StatusId > 1"><img style="float:right;padding-right:50px" src="/image/notification_error_meitu_1.jpg"/></tpl><tpl if="StatusId < 2"><img style="float:right;padding-right:50px" src="/image/error.gif"/></tpl>' ); Ext.regModel('Tweet',{ fields: [{ name: 'MetricId',type: 'int' },{ name: 'HostName',type: 'string' },{ name: 'MetricName',{ name: 'ParameterId',{ name: 'StatusId',{ name: 'UserDomain',{ name: 'ParentNodeId',{ name: 'NodeId',{ name: 'HasChildren',type: 'int' }] }); var store = new Ext.data.Store({ model: 'Tweet',proxy: { url: 'http://localhost:8080/exampleJsonpService/Nodes',type: 'jsonp',extraParams: { userName: 'admin',userDomain: 'admin' },reader: { root: '' } } }); store.getProxy(); store.read(); Ext.create('Ext.Container',{ fullscreen: true,layout: 'hbox',items: [ { xtype: 'toolbar',docked: 'top',height: 50,scrollable: { direction: 'horizontal',indicators: false },items: [ { ui: 'back',text: 'Back',handler: function () { alert("dfdsf"); } },{ text: 'Default' },{ ui: 'round',text: 'Round' },{ xtype: 'spacer' },{ xtype: 'segmentedbutton',items: [ { text: 'Option 1' },{ text: 'Option 2',pressed: true },{ text: 'Option 3' } ] },{ ui: 'action',text: 'Action' },{ ui: 'forward',text: 'Forward' },allowMultiple: true,items: [ { text: 'Toggle 1',{ text: 'Toggle 2',{ text: 'Toggle 3' } ] } ] },{ xtype: 'list',disclosure: true,onItemDisclosure: { scope: 'test',handler: function (record,btn,index) { store.getProxy().url = 'http://localhost:8080/exampleJsonpService/ChildNodes?parentNodeId=' + record.get('NodeId'); store.load(); } },itemSelector: '.tweet',itemTpl: tpl,store: store,flex: 1 },{ xtype: 'panel',html: 'message preview',flex: 2 } ] }); } }); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |