带有级联 DropDownList 的 Kendo UI 网格 [英] Kendo UI Grid with Cascading DropDownList

查看:20
本文介绍了带有级联 DropDownList 的 Kendo UI 网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Razor 布局上有一个 Kendo UI 网格,它从控制器获取数据.

I have a Kendo UI Grid on my Razor Layout which fetches data from the controller.

在这个网格中,我希望有一组 3 个 DropDownList,它们是:

In this grid I wish to have a set of 3 DropDownLists which are:

ProductGroupsProductsServices

我希望实现的行为是,当我向网格添加一行时,我首先选择 ProductGroups,然后 Products 下拉列表更新为过滤的产品列表GroupId(值).然后选择 Product 并像第一个一样,使用按 productId(值)过滤的服务更新 Services 下拉列表.

The behaviour I wish to implement is, when I Add a row to the Grid, I choose ProductGroups first, and the Products DropDown is updated with products list filtered by GroupId (value). Then select Product and like the first one, update the Services DropDown with services filtered by productId (value).

我不太清楚如何实现这一点,有人可以帮我吗?

I don't quite know how to achieve this, can anyone please help me?

感谢大家的帮助.

最好的问候.

推荐答案

最简单的方法是使用级联下拉列表:http://demos.kendoui.c​​om/web/dropdownlist/cascadingdropdownlist.html在这些列中的每一列的编辑器模板中.

The easiest way would be to use the cascading dropdownlists: http://demos.kendoui.com/web/dropdownlist/cascadingdropdownlist.html inside of the editor templates for each of these columns.

如果您使用弹出式编辑,您可以考虑自定义弹出式菜单,如下所示:http://www.kendoui.c​​om/code-library/mvc/grid/custom-popup-editor.aspx

If you are using popup editing you might consider customizing the popup menu like here: http://www.kendoui.com/code-library/mvc/grid/custom-popup-editor.aspx

如果您使用的是内联编辑,您应该使用这种方法来自定义编辑器模板:http://docs.kendoui.c​​om/documentation/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/editor-templates

If you are using InLine editing you should use this approach to customize the editor templates: http://docs.kendoui.com/documentation/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/editor-templates

如果您使用的是 InCell - 只能说这是不可能的.

If you are using InCell - lets just say its not possible.

这篇关于带有级联 DropDownList 的 Kendo UI 网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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