I am evaluating the KendoUI TreeView using this code snippet:
<TreeView
data={processTreeViewItems(workspaceGroups.current, {
select: select,
check: check,
expand: expand,
})}
focusIdField={"id"}
draggable={true}
expandIcons={true}
onExpandChange={onItemExpansionChanged}
aria-multiselectable={true}
onItemClick={onLayerItemClicked}
checkboxes={true}
onCheckChange={onItemCheckedChanged}
/>
I have declared a few constants and eventhandlers as follows:
function App() {
const [check, setCheck] = React.useState({
ids: ["100"],
idField: "id",
});
const [expand, setExpand] = useState({
ids: ["PROJECT WORKSPACES (5)", "Site Access Plan (8)"],
idField: "text",
});
const [select, setSelect] = useState({
ids: ["100"],
idField: "id",
});
I am having issues retrieving the correct value of the checked property from event.item in the onItemCheckedChange handler that looks like this:
const onLayerVisibilityChanged = (event: TreeViewCheckChangeEvent) => {
console.info("tree node checked or unchecked!!!")
const settings = {
singleMode: false,
checkChildren: true,
checkParents: false,
};
debugger
// if the UI checkbox is clicked, this value is false.// if the checkbox is unclicked, this value is true. It seems to be delayed.
console.info(event.item.checked)
};
What am I missing? I am using KendoUI TreeView 8.5.0.