PDA

View Full Version : [CLOSED] Fire Combobox Selection change event automatically



matrixwebtech
Aug 09, 2014, 5:39 AM
I have a combobox ,on page load I want to call autometically.

de.Select.Action = "/Pur_VendorInformation_GetByVendorID";


X.ComboBoxFor(obj => obj.Prefered_VendorID)
.FieldLabel("Vendor Name")
.AnchorHorizontal("100%")
.EmptyText("Select")
.EmptyValue(0)

.AllowBlank(true)
.DisplayField("VendorName")
.ValueField("VendorID")
.Editable(true)
.Width(350)
.QueryMode(DataLoadMode.Local)
.ForceSelection(true)
.TriggerAction(TriggerAction.All)
.LabelAlign(LabelAlign.Right)

.DirectEvents(de=>
{
de.Select.Action = "/Pur_VendorInformation_GetByVendorID";

de.Select.ExtraParams.Add(new Parameter
{
Name = "vendorID",
Value = "App.Prefered_VendorID.getValue()",
Mode = ParameterMode.Raw
});
})
.Triggers(
Html.X().FieldTrigger().Icon(TriggerIcon.Clear).Qt ip("Remove selected")

)
.Listeners(l=>{
l.TriggerClick.Handler = "this.clearValue();CleareFieldsByID('txtVendorAddre ss,txtCity,txtPin')";

})
.Store(
X.Store()

.Data(ViewBag.VendorName)
.ID("storeVendorName")
.Model(
X.Model()

.Fields(
Html.X().ModelField().Name("VendorID").Type(ModelFieldType.Int),
Html.X().ModelField().Name("VendorName").Type(ModelFieldType.String)

)
)

)

Daniil
Aug 10, 2014, 2:04 PM
Hi @matrixwebtech,

Please try this setting for the ComboBox.

.FireSelectOnLoad(true)

matrixwebtech
Aug 10, 2014, 3:33 PM
Thanks for reply .can be close.