EXT_grid_rowclick_jsonStore EXTJSP框架HTML
程序员文章站
2022-04-03 10:01:18
...
<html> <head> <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" /> <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="extjs/ext-all-debug.js"></script> <script> function fn() { //Ext.BLANK_IMAGE_URL ="/resource/extjs31/resources/images/default/tree/s.gif"; var data={totalCount:0,data:[{ID:'1',TITLE:'HAO',PUBTIME:'2009'},{ID:'33',TITLE:'3333',PUBTIME:'23333'}]}; var urlstr='/fbrole/main/itsmIndexGetInfoData.jsp?ch_id='+"<%=ch_id%>"; //数据部分 var store=new Ext.data.JsonStore({ start:0, limit:5, root:"data", totalProperty:"totalCount", idProperty:"ID", fields:["ID","TITLE","PROMULGATOR","PUBTIME"], proxy:new Ext.data.MemoryProxy(data) //proxy: new Ext.data.HttpProxy({ url:urlstr }) }); //框架部分 var mainPanel = new Ext.Panel({ layout:'border', applyTo:document.body, width:1023, height:500, items:[ new Ext.grid.GridPanel({ id:'gridepanel', title:"<%=ch_name%>", region:'center', frame:true, store:store, autoExpandColumn:2, listeners:{ rowclick : function(grid, rowIndex, e){ console.dir(e); var selections = grid.getSelectionModel().getSelections(); if (selections.length == 0) { Ext.Msg.alert('提示', "先选择行"); return; } for (var i = 0; i < selections.length; i++) { var record = selections[i]; alert(record.get("ID")); var id = record.get("ID"); var url = "panel.html"; window.open(url); } } }, tbar : new Ext.PagingToolbar({ store:store, pageSize:5,//每页显示几条记录 displayInfo:true, displayMsg:'第{0}条到{1}条,一共{2}条', emiptyMes:'没有记录' }), columns:[ new Ext.grid.RowNumberer(), {header:"标题",width:300,dataIndex:"TITLE"}, {header:"发布时间",dataIndex:"PUBTIME"} ] }) ] }); store.load({params:{start:0, limit:5}}); var el = Ext.getCmp('gridepanel'); //console.dir(el); } Ext.onReady(fn); </script> </head> <body> </body> </html>
上一篇: 简陋的JS日历 J#
下一篇: 动态表格例子2
推荐阅读
-
div + css 基本框架_html/css_WEB-ITnose
-
LESS CSS 框架简介_html/css_WEB-ITnose
-
html框架里的站内搜索_html/css_WEB-ITnose
-
Semantic UI ? 完全语义化的前端界面开发框架_html/css_WEB-ITnose
-
Guzzle ? 构建 RESTful Web 服务的 PHP HTTP 框架_html/css_WEB-ITnose
-
数字说话,震惊:TP框架,php,html,php静态页执行效率分析和对比
-
Yii框架中采用自己的写的html,不用框架自带widgets问题
-
急急急急急 求人帮忙调html框架集的布局,急急急急急急_html/css_WEB-ITnose
-
atitit.html编辑器的设计要点与框架选型 attilax总结_html/css_WEB-ITnose
-
CSS 框架:Basscss_html/css_WEB-ITnose