日期:2014-05-16 浏览次数:20433 次
Ext.onReady(function(){ var path = $("input[name=path]").val(); var sm = new Ext.grid.CheckboxSelectionModel({ }); //问题在此处!!! javascript代码没找到办法标红,请各位伤眼细看一下。谢谢 //此函数的三个参数不清楚,求解释 var oper = function( val, cellmeta, record ){ alert(val + " --- " + record + " === " + cellmeta); //var templateId = record.get('id'); var delBtn="<button onclick='delFloatIp()'>删除</button>"; var assignBtn="<button onclick='assignFloatIp()'>分配</button>"; return delBtn + " " + assignBtn; }; var cm= new Ext.grid.ColumnModel([ //sm, {header: 'IP', dataIndex: 'ip', width: 250, align:'center', sortable: true}, {header: 'Instance', dataIndex: 'instance', width: 300, align:'center', sortable: true}, {header: '操作', dataIndex: 'oper', width: 300, align:'center', renderer:oper} ]); var store = new Ext.data.JsonStore({ url: path+'/internet/floating_list.action', autoLoad: true, totalProperty: 'totalCount', successProperty: 'success', root: 'list', baseParams: {start: 0, limit: 10}, fields: [{name: 'id'},{name: 'ip'},{name: 'instance'}] }); //页面布局部分 var globalPanel = new Ext.Panel({ height: 395, layout: 'border', border: false, items:[{ split: true, width: 200, height: 200, split: true, region:'center', contentEl: 'queryGrid', border: false }] }); var grid = new Ext.grid.GridPanel({ title: '', stripeRows: true, loadMask: true, border: true, height: 395, cm: cm, //sm: sm, store: store, bbar: new Ext.PagingToolbar({ pageSize: 10, store: store, displayInfo: true, displayMsg: '<s:text name="iros.common.grid.record.note"/>',//'当前第 {0} - {1} 条记录 / 共 {2} 条', emptyMsg: '<s:text name="iros.common.grid.emptyMsg.note"/>'//目前无相关数据 }) }); grid.render('queryGrid'); });