I have a dataview that uses the following dataview:
[code] var dvThumb = thumbPanel.attachDataView({
type: {
template: “
#ord#
”,
template_loading: “Loading…”
}
});
// this allows the checkbox to be selected directly without first selecting the image/item.
dvThumb.attachEvent("onItemClick", function (id, ev, trg) {
if ((ev.target || ev.srcElement).tagName == "INPUT") {
return false;
}
});[/code]
The checkbox is unchecked after the “item” / image is selected or unselected. It appears to happen when the onSelectChange event is fired. Is there a way to maintain the state of the checkbox after onSelectChange fires?
You need to set “checked” for item when checkbox is clicked. It can be done by on_click collection. There you can set the event handler for html element of an item by its className. In my example it is ‘my_checkbox’ (see the template above):