Pages

Sunday, June 15, 2008

Check All Checkbox with DOJO Checkbox

I found a function which able to check all checkbox with DOJO Checkbox. Here is the following:

function checkAll(a,b){
var bChecked = false;
eval("dml = document.frTAMain");
var len = dml.elements.length;
for(var i=0 ; i<;i++){
if (dml.elements[i].type == "checkbox") {

for ( m=0; m <a.length;m++){
var id = (m+1);
if ((dml.elements[i].name == "selectAll") && (dml.elements[i].checked==true)) {
dijit.byId("comp"+id).setValue(true);
bChecked.setValue = true;
}

if ((dml.elements[i].name == "selectAll") && (dml.elements[i].checked==false)) {
dijit.byId("comp"+id).setValue(false);
bChecked.setValue = false;
}
}
}
}
}

At first I thought of putting in the function of click() which is the DOM function, however after the further studies on DOJO, dijit has their own method to check all which is dijit.byId().setValue (true/false).

Last weekend, I finally being able to pass value to DWR and DWR to Spring to the database and passing back to DWR to the javascripts. And now, it's time to learn how to display the value in the dijit.form.FilteringSelect with dwr values.


Wish me luck!

-Kay Nny

No comments:

Post a Comment