Checkbox插件无法在Jstree中运行 [英] Checkbox plugin not working in Jstree

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

问题描述

  -  scenario 

@model IEnumerable< Tesco.RetalixTenNFR.MVC.Models.AutSearchViewModel>

@ {
布局= null;
}
<!DOCTYPE html>
< html>
< body>
< script src =〜/ Scripts / jquery-1.8.2.min.js>< / script>
< script src =@ Url.Content(〜/ Scripts / jquery.jstree.js)type =text / javascript>< / script>
< link href =@ Url.Content(〜/ Scripts / themes / default / style.css) =stylesheettype =text / css/>
< div id =treestyle =height:300px; width:200px; float:left; overflow:scroll>
< ul id =Tree1>
@foreach(模型中的var项目)
{
if(item.Parent ==null)
{

< li>
< label for =@ item.Unit> @ item.Names< / label>
< ul id =Tree2>
@foreach(Model.Where中的var节点(x => x.Parent == @ item.Unit))
{
< li>
< input type =checkboxname =CategorySelectList
id =@ node.Unitvalue =@ node.Unit/>
< label for =@ node.Unit> @ node.Names< / label>
< / li>
}
< / ul>

< / li>

}
}
< / ul>

< / div>

< / body>
< / html>
< script type =text / javascript>
$(function(){
$(#tree)。jstree({
plugins:[themes,html_data,checkbox,ui]

});

});
< / script>





--Treeview工作正常,但疑问如下。



  - 插件:[主题,html_data,复选框,ui]。 
虽然我已经提到了复选框,但仍然没有复选框。我在哪里做错了。在foreach中我提到了复选框。我想摆脱那些输入复选框并从插件中获取复选框。

- 亲切帮助

解决方案

(function(){


< blockquote>(#tree)。jstree({
plugins:[themes,html_data,checkbox,ui]

});

});
< / script>





--Treeview工作正常,但疑问如下。



  - 插件:[主题,html_data,复选框,ui]。 
虽然我已经提到了复选框,但仍然没有复选框。我在哪里做错了。在foreach中我提到了复选框。我想摆脱那些输入复选框并从插件中获取复选框。

- 亲自帮助


--scenario

@model IEnumerable<Tesco.RetalixTenNFR.MVC.Models.AutSearchViewModel>

@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<body>
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script src="@Url.Content("~/Scripts/jquery.jstree.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Scripts/themes/default/style.css")" rel="stylesheet" type="text/css" />
    <div id="tree" style="height: 300px; width: 200px; float: left; overflow: scroll">
        <ul id="Tree1">
            @foreach (var item in Model)
            {
                if (item.Parent == "null")
                {
                
                <li>
                    <label for="@item.Unit">@item.Names</label>
                    <ul id="Tree2">
                        @foreach (var node in Model.Where(x => x.Parent == @item.Unit))
                        {
                            <li>
                                <input type="checkbox" name="CategorySelectList" 
                       id="@node.Unit" value="@node.Unit" />
                                <label for="@node.Unit">@node.Names</label>
                            </li>
                        }
                    </ul>

                </li>
           
                }
            }
        </ul>

    </div>

</body>
</html>
<script type="text/javascript">
    $(function () {
        $("#tree").jstree({
            "plugins": ["themes", "html_data", "checkbox", "ui"]

        });

    });
</script>



--Treeview is working properly but the doubt is as below.

--"plugins": ["themes", "html_data", "checkbox", "ui"].
Though I have mentioned checkbox, but still the checkbox is not coming. Where I am doing wrong. Inside the foreach I have mentioned the checkbox. I want to get rid of those input checkbox and get the checkbox from the plugin.

--Kindly help

解决方案

(function () {


("#tree").jstree({ "plugins": ["themes", "html_data", "checkbox", "ui"] }); }); </script>



--Treeview is working properly but the doubt is as below.

--"plugins": ["themes", "html_data", "checkbox", "ui"].
Though I have mentioned checkbox, but still the checkbox is not coming. Where I am doing wrong. Inside the foreach I have mentioned the checkbox. I want to get rid of those input checkbox and get the checkbox from the plugin.

--Kindly help


这篇关于Checkbox插件无法在Jstree中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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