hell_storm2004 hell_storm2004 - 22 days ago 6
Javascript Question

Unable to fetch Cell Value - DHTMLX

I am relatively new to this dhtmlx. I have to edit a value based on a checkbox selection. I am trying to do it. But somehow it throws a an exception. Tried almost all possible options of API. But nothing seems to work.

var x = document.getElementById("attendance");
if (x.checked === true) {
var classGrid= getClassGrid();
classGrid.cells("present",1).setValue("Y");
alert("done");
} else {
var classGrid = getClassGrid();
classGrid.cells("present",1).setValue("N");
alert("done");
}


The XML is something like this:

<row id="present"><cell class="label" image="blank.gif">Attendance </cell><cell id="leave" type="leaveType">Y</cell></row></rows>


The debugger keeps throwing a TypeException every time its hits the line,
classGrid.cells("present",1).setValue("Y");
or
classGrid.cells("present",1).setValue("N");

Answer

Well i was getting the DHTML grid the wrong way. Mods i guess you can delete this post as its more or less a non-issue!

Comments