[ExtJS5學習筆記]第十四節 Extjs5中data資料來源store和datapanel學習,extjs5datapanel

來源:互聯網
上載者:User

[ExtJS5學習筆記]第十四節 Extjs5中data資料來源store和datapanel學習,extjs5datapanel

本文地址:http://blog.csdn.net/sushengmiyan/article/details/39031383

sencha官方API: http://docs.sencha.com/extjs/5.0/apidocs/#!/api/Ext.grid.Panel-cfg-store

本文作者:sushengmiyan

------------------------------------------------------------------------------------------------------------------------------------

表格是現在web應用中常見的形式,而表格資料就是靈魂了,今天下班之後,短暫研究了下ext的表格。暫時琢磨出一點點東西來,先,後期再完善吧。

效果不是很理想:


還有點點報錯資訊,如下:


可以看到是layout導致的,將layout的boder方式登出,表格就可以正常顯示了:


這是官方例子顯示的效果,我這裡格式稍微有點點不大好看昂。

新增代碼如下:

{            xtype: 'panel',items:[{      xtype: 'gridpanel',  //title: '表格面板',  columns: [                { text: 'Name',  dataIndex: 'name'  },                { text: 'Email', dataIndex: 'email' },                { text: 'Phone', dataIndex: 'phone' }],  store: Ext.create(  'Ext.data.Store',  { //alias: 'paneldatastore', //storeId:'simpsonsStore', fields:['name', 'email', 'phone'], data:{'items':[{ 'name': 'Lisa',  "email":"lisa@simpsons.com",  "phone":"555-111-1224"  },{ 'name': 'Bart',  "email":"bart@simpsons.com",  "phone":"555-222-1234" },{ 'name': 'Homer', "email":"homer@simpsons.com",  "phone":"555-222-1244"  },{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254"  } ]}, proxy: {type: 'memory',reader: {type: 'json',rootProperty: 'items'}}  }),              renderTo: Ext.getBody()}]      }


使用第十一節代碼,修改裡面Main.js內容,增加如上代碼,就可以研究datastore和datapanel了。




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.