I'm all out of ideas and have no ideas on how to amend this problem. The issue is occurring in the expand function of Dynatree:
onExpand: function (select, dtnode) {
$("#tree :checkbox").addClass("hidden");
//$("#chb-" + dtnode.data.key).attr("checked", dtnode.isSelected()).addClass("hidden");
if (dtnode.isSelected()) {
$("#chb-" + dtnode.data.key).attr('checked', 'checked').addClass("hidden");
} else {
$("#chb-" + dtnode.data.key).removeAttr("checked").addClass("hidden");
}
},
when my tree is loaded all the outlay is correct - even the selected checkboxes that are set to be checked upon load.
(a) href="#" class="dynatree-title" title="Country" style="background: none;"> (input type="checkbox" id="chb-key7-2-1" name="Country: 14" value="Item 7-2-1" class="hidden" checked="checked")Australia (/a)
note the checked value is correctly set here - however when i then go to expand the parent of this node (I've set the tree to collapsed upon load finish) the 'checked' attribute is removed. this also happens if I normally select a node then collapse and re-expand the parent of that node.
Is there any solution for this I've looked and tried creating my own kind of solution but to no avail. Also could someone explain why the checked value is being removed when I expand the parent node of the selected child?
key tree settings:
$("#tree").dynatree({
persist: false,
checkbox: true,
selectMode: 3,
activeVisible: true,
clickFolderMode: 2,
noLink: false,
onActivate: function (node) {
node.data.expander.hide = true; //hide the expanders so i can use the text to expand
node.render(true);
},
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire