EXTJS 4.2 资料 控件之Grid Columns 列renderer 绑定事件

时间:2021-11-01 21:18:04
 columns: [
{ header: '序号', xtype: 'rownumberer', align: 'center', width: 100 },
{ header: 'CompanyId', dataIndex: 'CompanyId', width: 100, hidden: true },
{ header: '商家名称', dataIndex: 'CompanyName', width: 200 },
{ header: '商家英文名称', dataIndex: 'CompanyEngName', width: 200 },
{ header: '企业性质', dataIndex: 'NatureofBusiness', width: 200, hidden: true },
{ header: '注册资产', dataIndex: 'CertifiedPublicAssets', width: 100, hidden: true },
{ header: '会员编号', dataIndex: 'AccountID', width: 200, hidden: true },
{ header: '企业文化', dataIndex: 'BusinessSlug', width: 200 },
{
header: '操作', align: 'left', width: 300, renderer:
function (v, nv, v1) {
var News = 'News'; var Article = 'Article'; var Entertain = 'Entertain'; var Download = 'Download';
var News = "<img src='/Resources/Images/16x16/blue16_020.gif'></img>" + "<a href='#' onClick='FunctionActionUpdate(\"" + News + "\")'>商家新闻汇总</a>";
var Article = "<img src='/Resources/Images/16x16/blue16_020.gif'></img>" + "<a href='#' onClick='FunctionActionUpdate(\"" + Article + "\")'>商家文章汇总</a>";
var Entertain = "<img src='/Resources/Images/16x16/blue16_020.gif'></img>" + "<a href='#' onClick='FunctionActionUpdate(\"" + Entertain + "\")'>商家娱乐汇总</a>";
var Download = "<img src='/Resources/Images/16x16/blue16_020.gif'></img>" + "<a href='#' onClick='FunctionActionUpdate(\"" + Download + "\")'>商家资料汇总</a>";
return News + '' + Article + '' + Entertain + '' + Download;
}
}
],
    FunctionActionUpdate = function (ContentCategory) {
alert(ContentCategory); var width = document.getElementById('component').clientWidth;
var height = document.getElementById('component').clientHeight;
if (gridCompanyDetail.getSelectionModel().getSelection()[0] == null)
{ Ext.MessageBox.alert('提示', '请选择要编辑的记录!'); return; }
else
{
//这里要跳转页面
var subWindow = new Ext.Window({
title: '窗口',
width: width,
height: height,
modal: true,//模态的 后面的页面就不能点了
frame: true,
layout: 'fit',
closeAction: 'hide',
closable: true, //是否显示关闭按钮
maximizable: true,//最大化
minimizable: true,//最小化
listeners: {
minimize: function (subWindow, opts) {
subWindow.collapse();
}
},
html: '<iframe style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; width: "100%"; height:"100%"; border-right-width: 0px" src=/ProjectWeb/Page/InformationManagement/IM_BS_CompanyGather.html?ContentCategory=' + ContentCategory + ' frameborder="0" width="100%" height="100%"scrolling="no"></iframe>', });
subWindow.show();
}
}