checkboxes instead of multiselect
Anyone already implement checkboxes to support multiselect (including an all/nothing checkbox in th columnheader)
Marco
Marco
Marco
March 21,
// gridasGridObj is a pointer to the grid Object
// myData is the dataArray
/////////////////////////////////////////////////////
var checkArr = new Array(); // here is the result
/////////////////////////////////////////////////////
function multiCheck(){ // this function onload
var id = gridasGridObj.getId();
var count = myData.length;
var ptr= document.getElementById(id+".layout/left"); //hack to get the numCol
ptr.style.width="40px";
for(var i=0; i<count; i++){
var p = document.getElementById(id+".left.item:"+i+"/box");
var iX= document.createElement("INPUT");
iX.setAttribute("type", "checkbox");
iX.setAttribute("row", i);
iX.id ="chk_"+i;
addEvent(iX, "click", toggleOne); // crossbrowser_lib
var pf = p.appendChild(iX);
}
}
/////////////////////////////////////////////////////
function toggleAll(){
var count = myData.length;
for(var i=0; i<count; i++){
checkArr[i] = (checkArr[i]) ? false : true;
var p = document.getElementById("chk_"+i);
p.checked = checkArr[i];
}
}
/////////////////////////////////////////////////////
function toggleOne(e){
var xthis = (window.event) ? window.event.srcElement : this;
checkArr[xthis.getAttribute("row")] = xthis.checked
}
This topic is archived.
ActiveWidgets is a javascript library for creating user interfaces. It offers excellent performance for complex screens while staying simple, compact and easy to learn. Deployed by thousands of commercial customers in more than 70 countries worldwide.
Copyright © ActiveWidgets 2021