I'm using dhtmlxGrid on RoR. I have a checkbox and an event "onCheck" that gets activated each time the checkbox is checked.
<script type="text/javascript" charset="utf-8">
var grid = new dhtmlXGridObject("grid_here");
grid.setImagePath("/images/dhtmlx/imgs/");
grid.setHeader("Result, PatientID, Approved, Status, Approved Date");
grid.attachHeader("#text_filter,#text_filter,#text_filter,#text_filter,#text_filter");
grid.setColTypes("txt,ed,ch,co,ed");
grid.setColSorting("str,str,str,str,date");
grid.setInitWidths("100,100,*");
grid.setSkin("dhx_skyblue");
grid.init();
grid.load("/approves/data");
grid.attachEvent("onCheck",doOnCheckBoxSelected);
dp = new dataProcessor("/approves/dbaction.xml");
dp.init(grid);
function doOnCheckBoxSelected(rID, cInd, state)
{
if (state=='1')
{alert("date approved");}
}
</script>
The "alert" world fine when I check any checkbox. What I want to do now, is to automatically change the values in the cells "Status" and "Approved Date", when the checkbox is checked. The checkbox is called "Approved" and when people click on the "Approved" checkbox, I want the cell called "Approved Date" to be automatically updated with the current date, and the "Status" to change to "Approved".
I don't know how to store new values inside a grid cell.. How can I do this, is it possible?