PDA

View Full Version : consecutive checkbox



ajaynayak7
5 Sep 2012, 2:34 AM
Hi,
Can anyone help me out How to check CONSECUTIVE checkboxes in extjs3.4? That means It should allow very next and previous checkboxes and other should be readonly.


Thanks and Regards,
Ajay.

scottmartin
5 Sep 2012, 2:54 PM
Sounds like you just need to create some listeners and update the items (setDisabled) surrounding the selection based on your criteria?

Scott.

sword-it
6 Sep 2012, 1:39 AM
Hi!

you may done the same by following steps:-
1.Render your checkbox in a container (side by side, i.e. {check 1},{check2}...)
2.on check event of your all checkboxes, you may use setDisabled (as mentioned by Mr.ScottMartin) to enable disable your check boxes.

Here a sample for you, attach a check event on your all check boxes:-


listeners:{
check:function(cb,checked){
//find your all checkbox in a var allCheck and disable them, then use following code
cb.setDisabled(false);
cb.previousSibling().setDisabled(false); // enable previous checkbox
cb.nextSibling().setDisabled(false); // enable next checkbox
}
}