Apr 25, 2015, 11:25 AM
[CLOSED] How to get the record.data and ComponentColumn (combobox) selected value through Listeners ?
I have a grid defined as follows -
DataIndex "RegStatus" and the value selected.
I put a Select listener on the ComponentColumn as follows -
Can you please guide me, how this can be done ....
X.GridPanel()
.Region(Region.Center)
.ColumnWidth(0.6)
.AutoScroll(true)
.ID("gridRegistration")
.Layout(LayoutType.Fit)
.Store(X.Store()
.AutoLoad(false)
.ID("storeRegistration")
.Model(X.Model()
.IDProperty("CandidateID")
.Fields(f =>
{
f.Add(X.ModelField().Name("FormNumber"));
f.Add(X.ModelField().Name("RegStatus"));
})
).Reader(reader =>reader.Add(X.ArrayReader()))
)
.ColumnModel(
X.Column().Text("Reg. Number").DataIndex("RegistrationNumber").Flex(2),
X.ComponentColumn().Editor(true).Text("Reg. Status").DataIndex("RegStatus").Width(100).Component(X.ComboBox()
.Editable(false).QueryMode(DataLoadMode.Local).ForceSelection(true).TriggerAction(TriggerAction.All)
.DisplayField("Key")
.ValueField("Key")
.Editable(false)
.Listeners(ls => ls.Select.Handler = "onSelectStatus(this.getValue(), record.data.RegistrationNumber);")
.Store(X.Store()
.Model(X.Model()
.IDProperty("Key")
.Fields(
new ModelField("Key", ModelFieldType.String) { Mapping = "Key" }
)
).DataSource(Model.RegStatusList)))
)
.SelectionModel(
X.CheckboxSelectionModel().ID("SelectionModelId")
.Mode(SelectionMode.Multi)
)
.View(X.GridView().StripeRows(true).TrackOver(true))
My requirement is, when a user select a value in ComponentColumn corresponding to DataIndex "RegStatus", i need to do certain processing based on DataIndex "RegStatus" and the value selected.
I put a Select listener on the ComponentColumn as follows -
Listeners(ls => ls.Select.Handler = "onSelectStatus(this.getValue(), record.data.RegistrationNumber);")
this.getValue() is working fine, but i am not able to get the record data in the row (it says record is undefined). Can you please guide me, how this can be done ....
Last edited by Daniil; May 05, 2015 at 3:41 PM.
Reason: [CLOSED]