Kendo UI将控制值传递到数据源
嗨,我有一个相当简单的多选择下拉列表,其中以下数据源
@(Html.Kendo().MultiSelectFor(model => model.UserId)
.Name("UserId")
.HtmlAttributes(new { style = "width:100%;" })
.MinLength(2)
.Filter(FilterType.Contains)
.Placeholder("Select User...")
.AutoBind(false)
.Animation(false)
.MaxSelectedItems(1)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetUsers", "CommonJsonActions");
});
})
.DataValueField("UserId")
.DataTextField("DisplayName")
.BindTo(Model.Users)
.Value(Model.Users)
我想知道是否有一种方法可以将另一个下拉列表的选定值传递给多选择的dropdown(例如id formType)?还是我必须将代码移至.js文件以将jQuery用于此目的?
Hi I have a fairly simple MultiSelect dropdown with the following Datasource
@(Html.Kendo().MultiSelectFor(model => model.UserId)
.Name("UserId")
.HtmlAttributes(new { style = "width:100%;" })
.MinLength(2)
.Filter(FilterType.Contains)
.Placeholder("Select User...")
.AutoBind(false)
.Animation(false)
.MaxSelectedItems(1)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetUsers", "CommonJsonActions");
});
})
.DataValueField("UserId")
.DataTextField("DisplayName")
.BindTo(Model.Users)
.Value(Model.Users)
I'm wondering if there's a way I can pass the selected value of another dropdown, say id formType, to the MultiSelect? Or do I must move the code to .js file to utilize jquery for this purpose?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要将其他参数传递给动作,使用数据方法并提供JavaScript函数的名称,该函数将返回带有其他数据的JavaScript对象:
这是假设另一个下拉列表具有ID“ FormType”。操作方法应期望一个名为“ FormType”的附加参数。
To pass additional parameters to the action, use the Data method and provide the name of a JavaScript function which will return a JavaScript object with the additional data:
This is assuming the other DropDownList has an id "formType". The action method should expect an additional parameter named "formType".