Jstree set_type [英] Jstree set_type

查看:59
本文介绍了Jstree set_type的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将set_type方法绑定到我的jstree实例,然后在单击按钮时调用set_type方法.这是我的代码:

I'm binding a set_type method to my jstree instance, and then calling the set_type method when clicking a button. Here's my code:

$("#treeDiv").jstree({..}).bind("set_type.jstree", function(e, data) {
            $.post(
                "./classes/jstree/_demo/server.php", 
                {
                    "operation" : "set_type", 
                    "id" : data.rslt.obj.attr("id").replace("node_",""),
                    "type" : data.rslt.obj.attr("type")
                }, 
                function (r) {
                    if(!r.status) {
                        $.jstree.rollback(data.rlbk);
                    }
                }
            );
        });


$("#settype").click(function() {
    $("#treeDiv").jstree("set_type", "block", "#node_663");
});

图标的类型更改,但是类型值在db中不变.我在做什么错了?

Type of the icon changes, but the type value dosen't changes in db. What am I doing wrong?

推荐答案

已解决.我发现class.tree.php没有更新数据库类型的方法.

Solved it. I found that class.tree.php has no method that updates type in the database.

这篇关于Jstree set_type的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆