PDA

View Full Version : [CLOSED] Get selected text from Multiselect



matrixwebtech
Sep 24, 2014, 2:15 PM
X.MultiSelect()
.Height(260)
.ID("MS1")
.Width(300)
.Border(true)
.DisplayField("opText")
.ValueField("opValue")
.MaxSelections(1)
.SingleSelect(true)
.Listeners(l =>
{
l.Change.Handler = "console.log(App.MS1.getValue())";
})
.Store(X.Store()
.ID("Store1")
.Data(ViewBag.op)
.Model(X.Model()

.IDProperty("opValue")
.Fields(
Html.X().ModelField().Name("opValue").Mapping("opValue"),
Html.X().ModelField().Name("opText").Mapping("opText")
)
)

Above my sample Multiselect how do I get Text on


.Listeners(l =>
{
l.Change.Handler = "";
})

Currently I get Only value.

Daniil
Sep 25, 2014, 9:24 AM
Hi @matrixwebtech,

A MultiSelect's getSubmitArray returns an array of objects with value, text and index of selected items.

multiSelect.getSubmitArray();