Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/378.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 剑道UI多选绑定一个列表值以更改另一个多选列表_Javascript_Jquery_Asp.net Mvc_Asp.net Ajax - Fatal编程技术网

Javascript 剑道UI多选绑定一个列表值以更改另一个多选列表

Javascript 剑道UI多选绑定一个列表值以更改另一个多选列表,javascript,jquery,asp.net-mvc,asp.net-ajax,Javascript,Jquery,Asp.net Mvc,Asp.net Ajax,好的,我试图从剑道ui多选列表中获取值,然后根据MVC控制器发回的返回内容更改secound列表中的数组 这是post-back,它返回一个Json对象 [HttpPost] public ActionResult findProfileSettings(string selectedID) { var profiles_msl = obtainProfilesMethod(selectedID); ViewB

好的,我试图从剑道ui多选列表中获取值,然后根据MVC控制器发回的返回内容更改secound列表中的数组

这是post-back,它返回一个Json对象

[HttpPost]
        public ActionResult findProfileSettings(string selectedID)  
        {
            var profiles_msl = obtainProfilesMethod(selectedID);

            ViewBag.Profiles_msl = new List<Profiles>(profiles_msl);

            var result = new List<Profiles>(profiles_msl);

            return Json(result);
        }
这是一个需要改变的问题

  @(Html.Kendo().MultiSelect()
                    .Placeholder("Select Profiles")
                    .Name("Profiles")
                    .Value(new[] { new { } })
                    .HtmlAttributes(new
                    {
                        id = "ID",
                        data_bind = "options: Profiles_msl, optionsText: 'profiles', optionsValue: 'ID'"
                    })
                )
我认为问题在于我如何构建multi-select
任何帮助,谢谢

剑道UI multiselect没有“层叠自”元素,因此当前无法使用。

我认为您应该在第二个
multiselect
上使用过滤器。在第一个
MultiSelect
上为OnSelect添加一个事件,并在第二个
MultiSelect上触发刷新,同时发送第一个的值。这样你就不需要重新绑定了。@AndreiV ok听起来像是一个解决方案,你有例子吗?如果是这样的话,请发布一个答案,我现在没有。看看这个。这是相似的。
  @(Html.Kendo().MultiSelect()
                    .Placeholder("Select ")                    
                    .MaxSelectedItems(1)    
                    .Name("list")
                    .Value(new[] { new { } })
                    .HtmlAttributes(new
                    {
                        id = "MSL",
                        data_bind = " options: list, optionsText: 'ID', optionsValue: 'cid'"
                    })
                    .Events(e =>
                    {
                        e.Change("onChange");                                                
                    })                   
                )
  @(Html.Kendo().MultiSelect()
                    .Placeholder("Select Profiles")
                    .Name("Profiles")
                    .Value(new[] { new { } })
                    .HtmlAttributes(new
                    {
                        id = "ID",
                        data_bind = "options: Profiles_msl, optionsText: 'profiles', optionsValue: 'ID'"
                    })
                )