Apr 04, 2016, 10:46 AM
Using two way binding in GridPanel
Hello guys,
I am using Ext.Net MVC 2.5.2 and I need to use two way binding in a GridPanel.
The DataSource for the GridPanel is a list of Indicator object (List<Indicator>)
In the GridPanel Store, I tried to use StoreFor, but when I return in the controller using some button click action, the information in the model is not updated.
Thanks in advance
I am using Ext.Net MVC 2.5.2 and I need to use two way binding in a GridPanel.
The DataSource for the GridPanel is a list of Indicator object (List<Indicator>)
public class Indicator
{
public Indicator() { }
public string IndicatorCode { get; set; }
public string IndicatorDisplayText { get; set; }
public bool IndicatorValue { get; set; }
}
In the GridPanel Store, I tried to use StoreFor, but when I return in the controller using some button click action, the information in the model is not updated.
Html.X().GridPanel()
.Title(Res.ResourcesSM.SM_ConstFuncComp_EditComp_PnlIndic)
.ID("GridIndicators")
.AutoScroll(true)
.ColumnModel(
Html.X().Column()
.Text("Tip indicator")
.DataIndex("IndicatorDisplayText")
.Flex(1)
,
Html.X().CheckColumn()
.Text("Valoare")
.DataIndex("IndicatorValue")
.Align(Alignment.Center)
.Flex(1)
.Editable(true)
)
.Store(
Html.X().StoreFor(m => m.IndicatorsBindingList)
.Reader(Html.X().JsonReader().Root("data"))
)
I tried to use GridPanelFor, but the result is the same:Html.X().GridPanelFor(m => m.IndicatorsBindingList)
.Title(Res.ResourcesSM.SM_ConstFuncComp_EditComp_PnlIndic)
.ID("GridIndicators")
.AutoScroll(true)
.ColumnModel(
Html.X().Column()
.Text("Tip indicator")
.DataIndex("IndicatorDisplayText")
.Flex(1)
,
Html.X().CheckColumn()
.Text("Valoare")
.DataIndex("IndicatorValue")
.Align(Alignment.Center)
.Flex(1)
.Editable(true)
)
I thought that StoreFor or GridPanelFor have the same behavior as ComboBoxFor or TextFieldFor.Thanks in advance