I have the following code:
[code]function eXcell_myprice(cell) {
if (cell) {
this.cell = cell;
this.grid = this.cell.parentNode.grid;
eXcell_ed.call(this);
}
this.setValue = function (val) {
if (!val || val.toString()._dhx_trim() == “”) {
val = “$0.00”;
}
if (val == “.00001”) {
val = “$0.00”;
}
this.setCValue("" + val + “”, val);
}
this.getValue = function () {
return this.cell.childNodes[0].innerHTML;
}
}
eXcell_myprice.prototype = new eXcell;
var mygrid;
var mygrid1;
function doInitGrid() {
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath("…/codebase/imgs/");
mygrid.setHeader(“Item #,Manufacturer,Product Group / System, Description”, null, [“text-align:center;”, “text-align:left;”, “text-align:left”, “text-align:left”]);
mygrid.setInitWidthsP(“11,18,17,37”);
mygrid.setColAlign(“right,left,left,left”);
mygrid.enableAutoWidth(false);
mygrid.setColTypes(“ro,ro,ro,ro”);
mygrid.enableMultiselect(false);
mygrid.enableEditEvents(true, false, false);
mygrid.setColSorting(“str,str,str,str”);
mygrid.enableRowsHover(false, ‘grid_hover’);
mygrid.enableEditTabOnly(true);
mygrid.setSkin(“dhx_skyblue”);
mygrid.init();
mygrid.load("…/site_hospital8/connector_hospital_submit.php", function () {});
mygrid.attachEvent(“onXLE”, function (grid_obj, count) {
mygrid.insertColumn(0, ‘’, ‘ch’, 6, ‘na’, ‘center’);
mygrid.insertColumn(5, ‘Proposed Price’, ‘myprice’, 11, ‘na’, ‘center’);
mygrid.setNumberFormat("$0,000.00", 5);
});
mygrid.attachEvent(“onCheck”, function (rowId, cellInd, state) {
if (state) {
mygrid.forEachRow(function (id) {
mygrid.cells(id, 5).setValue(.00001);
return true
});
mygrid.checkAll(false);
mygrid.cellById(rowId, 0).setChecked(true);
mygrid.selectRow(rowId - 1);
mygrid.cellById(rowId, 0).cell.wasChanged = false;
} else {
mygrid.cellById(rowId, 5).setValue(.00001);
mygrid.cellById(rowId, 0).cell.wasChanged = false;
mygrid.cellById(rowId, 5).cell.wasChanged = false;
}
});
mygrid.attachEvent(“onRowSelect”, function (rowId, ind) {
if (ind != 5) {
if (mygrid.cellById(rowId, 0).isChecked()) {
mygrid.selectRow(rowId);
mygrid.cellById(rowId, 0).cell.wasChanged = false;
mygrid.cellById(rowId, 5).cell.wasChanged = false;
mygrid.cellById(rowId, 5).setValue(“0”);
mygrid.cellById(rowId, 0).setChecked(false);
} else {
mygrid.forEachRow(function (id) {
mygrid.cells(id, 5).setValue(.00001);
return true
});
mygrid.checkAll(false);
mygrid.cellById(rowId, 0).setChecked(true);
mygrid.cellById(rowId, 0).cell.wasChanged = false;
};
};
});
mygrid.attachEvent(“onEditCell”, function (stage, id, index, new_value, old_value) {
if (index == 5 && stage == 0) {
mygrid.forEachRow(function (id) {
mygrid.cells(id, 5).setValue(.00001);
return true
});
};
if (stage == 1 && mygrid.editor && mygrid.editor.obj) {
mygrid.editor.obj.select();
};
if (index == 5 && stage == 1) {
mygrid.checkAll(false);
mygrid.cellById(id, 0).setChecked(true);
mygrid.cellById(id, 0).cell.wasChanged = false;
return true;
}
return true;
});
function excelexport() {
mygrid.toExcel('../php/generate.php');
}[/code]
My price column starts off with $0.00 in every cell of the column, but once a price is entered only a number shows with no dollar sign next to it. I have already used setNumberFormat in the code so I’m not sure where I"m going wrong?