EXT.NET在服务器DirectEvent访问ComboBox值 [英] EXT.NET Accessing ComboBox value at server DirectEvent

查看:266
本文介绍了EXT.NET在服务器DirectEvent访问ComboBox值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Ext.Net MVC形式,发布值到DirectAction。在服务器端,在DirectAction CoboBox选择的值总是空的。

I have Ext.Net MVC form that post values to DirectAction. On server side, In DirectAction CoboBox selected value is always null.

public ActionResult Save()
{
var cmbSender = this.GetCmp<ComboBox>("cmbSender");
var senderID = cmbSender.SelectedItem.Value;
}

我已检查

Request["cmbSender"]

工作

<form id="form12">
@(
X.TabPanel()
    .Items(
        X.FormPanel()
        .Title("New Job")
        .ID("pnlNewJob")
        .Layout(LayoutType.Form)
        .MarginSpec("5 5 5 5")
        .Items(

X.Panel()
                                    .Border(false)
                                    .ColumnWidth(0.4)
                                    .Layout(LayoutType.Form)
                                    .Items(
                                        Html.X().ComboBox()
                                        .ID("cmbSender")
                                        .DisplayField("Code")
                                        .ValueField("ID")
                                        .EmptyText("Code")
)
</form>


推荐答案

FormPanel()的.Buttons()来发布你的表单数据。添加你的ComboBox选择值Button的DirectEvent。示例:

You can use X.FormPanel()'s .Buttons() to post your form data. Add your ComboBox selected value Button's DirectEvent. An example :

.Buttons(
Html.X()。Button()
.Text(AppTexts.Save )
.Icon(Icon.Accept)
.ID(SaveButton)
.DirectEvents(de =>
{
de.Click.Url = Url .Action(Save); de.Click.ExtraParams.Add(new Parameter
{
Name =cmbSelectedValue,
Value =App.cmbSender.getValue(),
Mode = ParameterMode.Raw
}
);
})

这篇关于EXT.NET在服务器DirectEvent访问ComboBox值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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