標籤:
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(); } }
EXTJS 4.2 資料 控制項之Grid Columns 列renderer 綁定事件