function main(spreadsheetReport, isAjaxRefreshCallback) {
if (!spreadsheetReport._newBtn) { // 不要重复添加按钮
//按钮样式
var input = document.createElement("INPUT");
input.type = "button";
input.className = "button-buttonbar button-bgicon-save";
input.value = "保存(S)";
input.title = "保存";
input.accessKey = "S";
input.style.width = "80";
input.style.height = "22";
//按钮位置定位
var div = document.createElement("div");
div.style.marginLeft = "20px";
div.style.float = "left";
var pElement = spreadsheetReport.elem_trPagePanel; //获取工具栏tr
if (!pElement.firstChild.firstChild) {
return;
}
pElement.firstChild.firstChild.style.float = "left";
if (pElement.clientWidth < 430) {
div.style.marginLeft = "5";
div.style.marginTop = "35";
}
div.appendChild(input);
//隐藏旧的保存按钮,并添加新按钮到报表页面
var nextEl = pElement.nextSibling;
if (nextEl.nodeName != "TR") {
nextEl = nextEl.nextSibling;
}
nextEl.style.display = "none";
var newBtn = pElement.firstChild.appendChild(div);
//按钮事件
spreadsheetReport.addListener(newBtn, "click",
function() {
spreadsheetReport.spreadsheetReportWriteBack.doSaveClick();
},
spreadsheetReport);
spreadsheetReport._newBtn = newBtn;
}
}