如题,大概的意思是把gridpanel中的数据嵌入到panel上?小弟的gridpanel数据是从数据库中读取的一个表字段,已经读出,但是不知道怎么嵌入到panel内?求高手解救?
------解决方案--------------------------------------------------------
不是很明白楼主的描述,如果是点击grid中某行,然后填充改行数据至某form,可以参考一下这个:
http://www.extjs.org.cn/node/485
------解决方案--------------------------------------------------------
panel.add(gridpanel)
------解决方案--------------------------------------------------------
- HTML code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>ccc</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="ext-2.0/resources/css/ext-all.css"> <script type="text/javascript" src="ext-2.0/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext-2.0/ext-all.js"></script> <script type="text/javascript" src="js/aa.js"></script> <script type="text/javascript"> Ext.onReady(function() { // grid开始 var arr = [['a1', 'b1', 'c1'], ['a2', 'b2', 'c2'], ['a3', 'b3', 'c3']]; var reader = new Ext.data.ArrayReader({}, [{ name : 'A' }, { name : 'B' }, { name : 'C' }]); var store = new Ext.data.Store({ reader : reader }); store.loadData(arr); var col = new Ext.grid.ColumnModel([{ header : 'A大列', hidden : false, dataIndex : 'A' }, { header : 'B大列', hidden : false, dataIndex : 'B' }, { header : 'C大列', hidden : false, dataIndex : 'C' }]); var grid = new Ext.grid.GridPanel({ el : 'tree', height : 200, width : 400, id : 'grid', store : store, cm : col }); grid.render(); var panel = new Ext.Panel({ title : 'ddd', autoHeight : true, frame : true, items:[grid], renderTo : Ext.getBody() }) // grid结束})</script> </head> <body> <div id="tree"></div> </body></html>