jsp页面用jquery.treeView点击父节点文本弹出子节点怎么弄啊???

不是点击前面的+号... 不是点击前面的+号 展开
 我来答
百度网友46b235f5b2
推荐于2018-05-09 · TA获得超过1397个赞
知道小有建树答主
回答量:676
采纳率:100%
帮助的人:627万
展开全部
你说的+号是: onnodeclick:function(item){.....},你打开那个tree.js文件,看看这个事件是怎么写的,然后你照写一个,比如: onnodetextclick:function(item){}
下边是节点点击的事件,我没时间去看它的代码,暂时就发给你,你增加一个文本点击的事件

$.fn.treeview = function(settings) {
var dfop =
{
method: "POST",
datatype: "json",
/**
* @description {Config} url
* {String} Url for child nodes retrieving.
*/
url: false,
/**
* @description {Config} cbiconpath
* {String} Checkbox image path.
*/
cbiconpath: "./css/images/icons/",
icons: ["checkbox_0.gif", "checkbox_1.gif", "checkbox_2.gif"],
/**
* @description {Config} showcheck
* {Boolean} Whether to show check box or not.
*/
showcheck: false,
/**
* @description {Event} oncheckboxclick:function(tree, item, status)
* Fired when check box is clicked on.
* @param {Object} tree This tree object.
* @param {Object} item Node item clicked on.
* @param {Number} status 1 for checked, 0 for unchecked.
*/
oncheckboxclick: false,
/**
* @description {Event} onnodeclick:function(tree, item)
* Fired when a node is clicked on.
* @param {Object} tree This tree object.
* @param {Object} item Ndde item clicked on.
*/
onnodeclick: false,
/**
* @description {Config} cascadecheck
* {Boolean} Whether node being seleted leads to parent/sub node being selected.
*/
cascadecheck: true,
/**
* @description {Config} data
* {Object} Tree theme. Three themes provided. 'bbit-tree-lines' ,'bbit-tree-no-lines' and 'bbit-tree-arrows'.
* @sample
* data:[{
* id:"node1", //node id
* text:"node 1", //node text for display.
* value:"1", //node value
* showcheck:false, //whether to show checkbox
* checkstate:0, //Checkbox checking state. 0 for unchecked, 1 for partial checked, 2 for checked.
* hasChildren:true, //If hasChildren and complete set to true, and ChildNodes is empty, tree will request server to get sub node.
* isexpand:false, //Expand or collapse.
* complete:false, //See hasChildren.
* ChildNodes:[] // child nodes
* }]
* */
data: null,
/**
* @description {Config} clicktoggle
* {String} Whether to toggle node when node clicked.
*/
clicktoggle: true,
/**
* @description {Config} theme
* {String} Tree theme. Three themes provided. 'bbit-tree-lines' ,'bbit-tree-no-lines' and 'bbit-tree-arrows'.
*/
theme: "bbit-tree-arrows" //bbit-tree-lines ,bbit-tree-no-lines,bbit-tree-arrows
};

function nodeclick(e) {
var path = $(this).attr("tpath");
var et = e.target || e.srcElement;
var item = getItem(path);
if (et.tagName == "IMG") {
//+ if collapsed, expend it
if ($(et).hasClass("bbit-tree-elbow-plus") || $(et).hasClass("bbit-tree-elbow-end-plus")) {
var ul = $(this).next(); //"bbit-tree-node-ct"
if (ul.hasClass("bbit-tree-node-ct")) {
ul.show();
}
else {
var deep = path.split(".").length;
if (item.complete) {
item.ChildNodes != null && asnybuild(item.ChildNodes, deep, path, ul, item);
}
else {
$(this).addClass("bbit-tree-node-loading");
asnyloadc(item, true, function(data) {
item.complete = true;
item.ChildNodes = data;
asnybuild(data, deep, path, ul, item);
});
}
}
if ($(et).hasClass("bbit-tree-elbow-plus")) {
$(et).swapClass("bbit-tree-elbow-plus", "bbit-tree-elbow-minus");
}
else {
$(et).swapClass("bbit-tree-elbow-end-plus", "bbit-tree-elbow-end-minus");
}
if(dfop.theme!="bbit-tree-lines-no-folder")
$(this).swapClass("bbit-tree-node-collapsed", "bbit-tree-node-expanded");
}
//if expended, collapse it
else if ($(et).hasClass("bbit-tree-elbow-minus") || $(et).hasClass("bbit-tree-elbow-end-minus")) {
$(this).next().hide();
if ($(et).hasClass("bbit-tree-elbow-minus")) {
$(et).swapClass("bbit-tree-elbow-minus", "bbit-tree-elbow-plus");
}
else {
$(et).swapClass("bbit-tree-elbow-end-minus", "bbit-tree-elbow-end-plus");
}
if(dfop.theme!="bbit-tree-lines-no-folder")
$(this).swapClass("bbit-tree-node-expanded", "bbit-tree-node-collapsed");
}
else if ($(et).hasClass("bbit-tree-node-cb")) // click on checkbox
{
var s = item.checkstate != 1 ? 1 : 0;
var r = true;
if (dfop.oncheckboxclick) {
r = dfop.oncheckboxclick.call(et, item, s);
}
if (r != false) {
if (dfop.cascadecheck) {
cascade(check, item, s);
bubble(check, item, s);
}
else {
check(item, s, 1);
}
}
}
}
else {
if (dfop.citem) {
var nid = dfop.citem.id.replace(/[^\w]/gi, "_");
$("#" + id + "_" + nid).removeClass("bbit-tree-selected");
}
dfop.citem = item;
$(this).addClass("bbit-tree-selected");
if (dfop.onnodeclick) {
if (!item.expand) {
item.expand = function() { expandnode.call(item); };
}
dfop.onnodeclick.call(this, item);
}
}
}
匿名_热心网友
2011-10-30 · TA获得超过719个赞
知道大有可为答主
回答量:3827
采纳率:0%
帮助的人:8373万
展开全部
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=" & (page+1) & ">"
response.write "下一页</a> <a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&SmallClass="&SmallClass&"&page="&rs.pagecount&">尾页</a>"
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式