jQuery UI Widgets › Forums › Navigation › Tree › Drag an item fires checkchange function
Tagged: checkboxes, dragdrop, jqxtree
This topic contains 1 reply, has 2 voices, and was last updated by ivailo 9 years, 2 months ago.
-
Author
-
Hi:
I’ve created a tree with three states checkboxes that has the drag and drop functionality, also, i have a function in the checkchange event that works fine when i check/uncheck an item, but whenever i drag-drop an item it fires the checkchange event too, i want to skip the function in that case (when performs drag-drop event), how should i do that?
Thanks in advance, here’s my code:
<!DOCTYPE html>
<html lang=”en”>
<head>
<link rel=”stylesheet” href=”../../jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”../../scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxdata.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxpanel.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxtree.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxcheckbox.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxexpander.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxmenu.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxdropdownbutton.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxdragdrop.js”></script>
<script type=”text/javascript”>
$(document).ready(function () {
$(‘#jqxTree’).jqxTree({width: 500, height: 700, checkboxes: true, hasThreeStates: true, allowDrag: true, allowDrop: true});
$(‘#jqxTree’).on(‘checkChange’, function (event) {
console.log(event.args.element);
//i call a webservice on this function that performs a database transaction updating the status of the element
});
});
</script>
</head>
<body class=’default’>
<div id=’jqxWidget’>
<div style=’float: left;’>
<div id=’jqxTree’ style=float: left; margin-left: 20px;’>
<li id=’0’ item-checked=’true’>Root-
<li id=’1’ item-checked=’true’ item-expanded=’true’>CATALOGS
-
<li id=’2’ item-checked=’true’ >AGENCIES
<li id=’3’ >AREAS<li id=’8’ item-checked=’true’ item-expanded=’true’>CLASIFICATION
-
<li id=’9’>ENTITIES
<li id=’10’ item-checked=’true’ >DEPENDENCIES</div>
</div>
</div>
</body>
</html>Hi alekzvargas,
Thanks for the feedback. We will investigate the problem.
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.