jQWidgets Forums
Forum Replies Created
-
Author
-
Hi Nadezhda,
Thanks for your valuable support.
Hi Nadezhda,
It is not a jqxDropDownList’s change event. It is an normal html dropdownlist jquery event.
Drop Down Change :
$(“#ddlPrevilegeID”).change(function () {
if ($(“#ddlGropID”).val() != 0)
{
if ($(“#ddlPrevilegeID”).val() == 0)
{
//ApproveCheckBox();
$(“input.New-check”).attr(“disabled”, true);
}
else
{
$(“input.New-check”).attr(“disabled”, false);
var GroupID = $(“#ddlGropID”).val();
GetApprove(GroupID); /// This is the function called in dropdown change
}
}
else
{
alert(“First Select GroupName..!”)
$(“#ddlPrevilegeID”).val(“0”);
}
});
Function as Follows :var source=null;`
function GetApprove(GroupID) {
$.ajax({
type: “POST”,
contentType: “application/json; charset=utf-8”,
url: “WebService/TreeviewCheckbox.asmx/TreeviewCheckBoxApprove”,
data: “{GroupID:'” + GroupID + “‘}”,
dataType: “json”,
success: function (data) {
` source = data.d;
},
error: function (result) {
alert(“Error” + result);
},
complete: function () {
$(“#jqxTree”).html(source);
$(‘#jqxTree’).jqxTree({ height: ‘auto’, width: ‘auto’, hasThreeStates: true, checkboxes: true }); // This is the problem it collapse the tree when we rebind the data and call it. Design Tree view collapsed
},
});
}Thanks
Sugesh
Hi Nadezhda,
Yes, I removed loadItems and expand in the jqxtree initialization but no luck. I calling in page Load Working fine. I am using jquery to get data from the server. So the page is not load or postback. when the user change the dropdown i need to pass the value and get the data from the server in the same page and rebind it. I tried all the things. Before i bind i clear the div and rebind it and call the jqxtree initialization but no luck. Tree view designed is collapsed. Please help me on this.
<link rel=”Stylesheet” type=”text/css” href=”CSS/StyleSheetj.css” />
<script type=”text/javascript” language=”javascript” src=”Scripts/jquery-1.4.1.min.js”></script>
<script type=”text/javascript” language=”javascript” src=”Scripts/jqwidgets-jqxcore.js”></script>
<script type=”text/javascript” language=”javascript” src=”Scripts/jqwidgets-jqxbuttons.js”></script>
<script type=”text/javascript” language=”javascript” src=”Scripts/jqwidgets-jqxscrollbar.js”></script>
<script type=”text/javascript” language=”javascript” src=”Scripts/jqwidgets-jqxpanel.js”></script>
<script type=”text/javascript” language=”javascript” src=”Scripts/jqwidgets-jqxtree.js”></script>
<script type=”text/javascript” language=”javascript” src=”Scripts/jqwidgets-jqxcheckbox.js”></script>Here is the page Load Function as follows :
var source = null;
$(document).ready(function () {
$.ajax({
type: “POST”,
contentType: “application/json; charset=utf-8”,
url: “WebService/TreeviewCheckbox.asmx/TreeviewDataCheckBox”,
data: “{}”,
dataType: “json”,
success: function (data) {source = data.d;
},
error: function (result) {
alert(“Error”);
},
complete: function () {
$(“#jqxTree”).html(source);
$(‘#jqxTree’).jqxTree({ height: ‘auto’, width: ‘auto’, hasThreeStates: true, checkboxes: true, loadItems: true });
},
});
});
Page Load is working Fine
The Problem is I need to go to the server and get the data in dropdown change. When i want to append the html and recall the JQXtree function is not working. Design is collapsed. Code is shown below.
var Output_source=null;
function GetApprove(GroupID) {
$.ajax({
type: “POST”,
contentType: “application/json; charset=utf-8”,
url: “WebService/TreeviewCheckbox.asmx/TreeviewCheckBoxApprove”,
data: “{GroupID:'” + GroupID + “‘}”,
dataType: “json”,
success: function (data) {
//$(“#jqxTree”).html(“”);
$(“#jqxTree”).removeClass();
Output_source = data.d;
},
error: function (result) {
alert(“Error” + result);
},
complete: function () {
$(“#jqxTree”).html(Output_source);
$(‘#jqxTree’).jqxTree({ height: ‘auto’, width: ‘auto’, hasThreeStates: true, checkboxes: true, loadItems: true,expand:true });
},
});
}Note :
If i comment the $(‘#jqxTree’).jqxTree({}); in page load Dropdown change GetApprove(GroupID) working correctly. Either one is working at a time. I need to Work both. Please help me on this
-
AuthorPosts