I get the messages ‘dhtmlx’ is undefined in dhtmlxgrid.js Line 896
and _isIE is undefined line 18
Please help ASAP. I suspect this is why grid is not displaying in all browsers.
Setting up of grid is this:
mygrid = new dhtmlXGridObject(‘gridbox’);
//call to automatically select on edit of cell
mygrid.attachEvent(“onEditCell”,function(stage) {
if (stage == 1) {
this.editor.obj.select();
}
return true;
});
//call to calculate other values and validate edits
mygrid.attachEvent(“onEditCell”, doEditBonusValue);
//--------------------------------------------------------------
//function fires before xml data starts loading
mygrid.attachEvent(“onXLS”, function(){
mygrid.my_loading_flag = true;
alert(‘loading1’);
});
mygrid.attachEvent(“onXLE”, function(){
alert(‘loading2’);
mygrid.my_loading_flag = false;
mygrid.cells(‘BONUSTOTAL’,5).setValue(<%=TotalBonusColumn%>);
if (document.forms[0].hidAction.value==‘GlobalPercent’) {
if (mygrid._expand_all_callback)
expand_all();
LoopGrid();
} else if (document.forms[0].hidAction.value==‘SavingSession’) {
//alert(‘in onXLE with SavingSession’);
if (mygrid._expand_all_callback) {
// alert(‘expanding there’);
expand_all();
}
} else if (document.forms[0].hidAction.value==‘ExpandCollapse’) {
if (mygrid._expand_all_callback) {
// alert(‘expanding there’);
expand_all();
}
}
});
//function to expand all data grid
function expand_all(callback){
if (callback) mygrid._expand_all_callback = callback;
mygrid._h2.forEachChild(0,function(row){
if (mygrid.my_loading_flag) return;
if (row.state == "plus") {
mygrid.openItem(row.id);
}
});
if (mygrid._expand_all_callback && !mygrid.my_loading_flag){
var temp = mygrid._expand_all_callback;
mygrid._expand_all_callback = null;
temp();
}
}
//--------------------------------------------------------------
//function to validate percentage number is < 3 places
function validatePercentage() {
var num = document.forms[0].txtGlobalPercent.value;
num = num.toString();
if (num.indexOf(’.’) > -1) {
var split = num.split(".");
var dec = split[1].substr(0,3);
if (dec.length <= 2)
return true
else
return false;
} else {
return true;
}
}
//--------------------------------------------------------------
//function to apply Global Percentage, validate and refresh
function do_it(){
var i = 0;
var iRet = validatePercentage();
if (iRet == false) {
alert(‘You can enter no more than 2 decimal places.’);
document.forms[0].txtGlobalPercent.focus();
return false;
}
document.forms[0].hidAction.value=“GlobalPercent”;
HourglassOn();
expand_all(function(){
//alert(“ready”)
LoopGrid();
HourglassOff();
});
};
//--------------------------------------------------------------
//function to expand/collapse grid if name clicked on
mygrid.attachEvent(“onRowSelect”, function(id, ind){
if (ind == 0) {
var expanded = mygrid.getOpenState(id);
if (!expanded) {
mygrid.openItem(id);
} else {
mygrid.closeItem(id);
}
}
});
//--------------------------------------------------------------
mygrid.selMultiRows = true;
mygrid.enableTreeCellEdit(false);
mygrid.imgURL = “dhtmlxGrid/codebase/imgs/icons_greenfolders/”;
mygrid.setHeader(“Employee,Notes
and
Warnings,Manager’s
Budget
(US Dollars),Bonuses Assigned
to Direct Reports
(US Dollars),<%=currYear%>
Eligible Salary,<%=currYear%>
Proposed Bonus
(US Dollars),% of <%=currYear%>
Eligible Salary,Total Cash
Compensation
(Salary + Bonus)
(US Dollars),<%=prevYear%> Bonus
(Local Currency),<%=currYear%>-<%=prevYear%>
Bonus Difference
(Local Currency),Bonus Eligible,”,null,[“text-align:center;”,“text-align:center;”,“text-align:center;”,“text-align:center;”,“text-align:center;”,“text-align:center;”,“text-align:center;”,“text-align:center;”,“text-align:center;”,“text-align:center;”,“text-align:center;border-right:none”,“text-align:center”]);
//--------------------------------------------------------------
mygrid.setInitWidthsP(“14,21,8,9,7,7,7,8,8,8,*,0”);
mygrid.setColAlign(“left,left,center,center,center,center,center,center,center,center,center,center”);
mygrid.setColTypes(“tree,ro,ed,ro,ro,ed,ed,ro,ro,ro,ro,ro”);
mygrid.enableAutoHeight(true);
mygrid.init();
mygrid.setColumnHidden(11,true);
mygrid.setSkin(“dhx_skyblue”);
mygrid.enableAlterCss(“background-color: #FFF”,“background-color: #FFF”);
mygrid.setImagePath(“images/”);
mygrid.kidsXmlFile = “SPGetSubData.asp?iLoggedInEmpId=<%=iLoggedInEmpId%>&empid=<%=iEmpId%>”;
mygrid.loadXML(“SPGetData.asp?iLoggedInEmpId=<%=iLoggedInEmpId%>&empid=<%=iEmpId%>”);
//define dataprocessor
var dp = new dataProcessor(“SendSPData.asp?cn=<%=Request.Querystring(“cn”)%>&iLoggedInEmpId=<%=Request.Querystring(“iLoggedInEmpId”)%>&Username=<%=Request.Querystring(“Username”)%>”);
//after save to session db, set flags, validate and refresh data
//--------------------------------------------------------------
dp.attachEvent(“onAfterUpdate”,function() {
HourglassOn();
releaseDirtyFlag();
mygrid.clearAll();
mygrid.loadXML(“SPGetData.asp?uid=”+mygrid.uid()+"&iLoggedInEmpId=<%=Request.Querystring(“iLoggedInEmpId”)%>&empid=<%=Request.Querystring(“iEmpId”)%>");
expand_all(function(){
AddBonusTotal(’<%=budget_value%>’,’<%=bDeadEnd%>’);
iRet = ValidateTotals(<%=budget_value%>);
if (iRet) {
//true
document.forms[0].btnSavePermanent.disabled = 0;
document.forms[0].btnSavePermanent2.disabled = 0;
} else {
//false - keep disabled
document.forms[0].btnSavePermanent.disabled = 1;
document.forms[0].btnSavePermanent2.disabled = 1;
}
alert(‘Done validating all values. Your Draft Spreadsheet has been saved for later reuse.’);
HourglassOff();
bActionInProgress = false;
});
})
dp.init(mygrid);
//lock feed url;
dp.setTransactionMode(“POST”, true);
dp.setUpdateMode(“off”);