Jquery TreeView折叠/展开回调事件 [英] Jquery TreeView Collapse/Expand Callback event
问题描述
我在Jquery treeview API下面使用过。它工作正常。
http://www.dynamicdrive.com/dynamicindex1/treeview/ [ ^ ]
在扩展树视图(节点)的分支时,我使用切换方法完成了回调函数。但是问题是,崩溃期间调用的切换事件也是如此。我的回调方法必须只适用于展开事件而不适用于崩溃事件。
请帮忙。如何在切换方法中找出事件名称..
我的代码贴在这里
Hi,
I have used below Jquery treeview API. it works fine.
http://www.dynamicdrive.com/dynamicindex1/treeview/[^]
while expanding the branch of tree view(node), i have done a callback function using the toggle method.But the problem, the toggle event called during collapse also. My callback method have to work for expand event only not for collapse event.
Please help on this. How to find out the event name in toggle method..
My code posted here
$(document).ready(function () {
$("#navigation").treeview({
persist: "location",
collapsed: true,
animated: "medium",
control: "#treecontrol",
toggle: function () {
var swimlaneId = this.id.replace('listSwimlane', 'ulActivity');
$.ajax({
type: "POST",
url: "Test.aspx?Action=load&SwimlaneID=5",
// data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "html",
success: function (msg) {
alert(msg);
$("#" + swimlaneId).html(msg);
},
error: function (msg) {
alert(msg.d);
}
});
// $("#" + this.id.replace('listSwimlane', 'ulActivity')).load("Test.aspx?SwimlaneID=1 #divActivities");
}
});
谢谢,
Sheik
Thanks,
Sheik
推荐答案
( document )。ready( function (){
(document).ready(function () {
( #navigation)。treeview({
persist: location,
已折叠: true ,
动画: medium,
control: #treecontrol,
toggle: function (){
< span class =code-keyword> var swimlaneId = this .id.replace(' listSwimlane' ,' ulActivity');
("#navigation").treeview({ persist: "location", collapsed: true, animated: "medium", control: "#treecontrol", toggle: function () { var swimlaneId = this.id.replace('listSwimlane', 'ulActivity');
.ajax({
类型: POST,
url: Test.aspx?Action = load& SwimlaneID = 5,
/ / data:{},
contentType: 应用/ JSON; charset = utf-8,
dataType: html,
成功: function (msg){
alert(msg);
.ajax({ type: "POST", url: "Test.aspx?Action=load&SwimlaneID=5", // data: "{}", contentType: "application/json; charset=utf-8", dataType: "html", success: function (msg) { alert(msg);
这篇关于Jquery TreeView折叠/展开回调事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!