function main(insight) {
if (typeof(insight.old_rebuildParamPanel) == "undefined") {
insight.old_rebuildParamPanel = insight.rebuildParamPanel;
insight.rebuildParamPanel = function() {
this.old_rebuildParamPanel();
addBtns(this);
};
}
}
//添加按钮
function addBtns(insight) {
var paramTable = insight.paramPanelObj.layoutTable;
var i, cell, lastCell1, lastCell2;
for (i = 0; i < paramTable.rows.length; i++) {
cell = paramTable.rows[i].insertCell(-1);
if (i == 0) lastCell1 = cell; //paramTable.rows.length - 1
if (i == 1) lastCell2 = cell;
}
//添加分析按钮
if (lastCell1) {
var btnElem = document.createElement("button");
btnElem.innerText = "分析";
btnElem.className = "queryview-toolbar-button";
btnElem.style.border = "1px solid #A1ACB9";
btnElem.style.width = "60px";
btnElem.style.height = "23px";
btnElem.style.padding = "2px 0 0 0";
btnElem.style.margin = "0 10px 0 10px";
insight.addListener(btnElem, 'click',
function() {
insight.doRefresh();
}, this);
lastCell1.appendChild(btnElem);
}
//添加导出按钮
if (lastCell2) {
var btnExport = document.createElement("button");
btnExport.innerText = "导出";
btnExport.className = "queryview-toolbar-button";
btnExport.style.border = "1px solid #A1ACB9";
btnExport.style.width = "60px";
btnExport.style.height = "23px";
btnExport.style.padding = "2px 0 0 0";
btnExport.style.margin = "0 10px 0 10px";
insight.addListener(btnExport, "click",
function() {
insight.doExportMenuCloseUp("EXCEL2007");
}, this);
lastCell2.appendChild(btnExport);
}
}