Jan 28, 2016, 10:17 AM
EXT.NET MVC GridPanel filter's comboBox's Listerners error
I have a big problem with my GridPanel filter's comboBox's from EXT.NET MVC.
I've added listeners to my columns comboBoxes for date and number types columns and it works very well but when I try to use listeners for text type column with a combobox as column filter it said : You can't use lambda expression for an operation done dynamically you must cast as delegate or as expression trees... something like that (Actually i'm french I can't translate this error properly) I don't understad this error and why I can't use lambda expression for this Listerners while I can use it for the other types.
Can you help me to find out a solution? Thank you :)
Here's the PartialView code :
I've added listeners to my columns comboBoxes for date and number types columns and it works very well but when I try to use listeners for text type column with a combobox as column filter it said : You can't use lambda expression for an operation done dynamically you must cast as delegate or as expression trees... something like that (Actually i'm french I can't translate this error properly) I don't understad this error and why I can't use lambda expression for this Listerners while I can use it for the other types.
Can you help me to find out a solution? Thank you :)
Here's the PartialView code :
@Html.X().ResourceManager().RenderStyles(ResourceLocationType.Embedded).Theme(Theme.Gray)
@(
Html.X().GridPanel()
.Title("GridRtv")
.ID("GridRtv")
.Layout(LayoutType.Auto)
.Height(400)
.AutoScroll(true)
.AutoShow(true)
.Store(Html.X().Store()
.ID("StoreRtv")
.Model(Html.X().Model()
.Fields(
new ModelField("RTV_DL", ModelFieldType.Date),
new ModelField("RTV_TR", ModelFieldType.String),
new ModelField("RTV_NF", ModelFieldType.String)
)
)
.DataSource(@ViewBag.ListeLV)
)
.ColumnModel(
Html.X().DateColumn()
.Text("Date création")
.DataIndex("RTV_DL")
.Format("dd/MM/yyyy")
.Items(
Html.X().DateField()
.ID("RTV_DLFilter")
.Editable(false)
.Listeners(l =>
{
l.Change.Handler = "applyFilter(this);";
})
.Plugins(Html.X().ClearButton())
),
Html.X().Column()
.Text("Type R")
.DataIndex("RTV_TR")
.Items(
Html.X().ComboBox()
.ID("ComboBoxRTV_TR")
.Icon(Icon.Magnifier)
.TriggerAction(TriggerAction.All)
.QueryMode(DataLoadMode.Default)
.DisplayField("RTV_TR")
.ValueField("RTV_TR")
.Store(
Html.X().Store()
.DataSource(@ViewBag.ListeLV)
.Model(Html.X().Model()
.Fields(
Html.X().ModelField().Name("RTV_TR")
)
)
)
/**HERE'S THE PROBLEM**/
.Listeners(l =>
{
l.Change.Handler = "applyFilter(this);";
l.Change.Buffer = 250;
})
/****/
.Plugins(Html.X().ClearButton())
),
Html.X().Column()
.Text("Code F")
.DataIndex("RTV_NF")
.Renderer(RendererFormat.Round)
.Items(
Html.X().TextField()
.ID("RTV_NFFilter")
.Listeners(l =>
{
l.Change.Handler = "applyFilter(this);";
l.Change.Buffer = 250;
})
.Plugins(Html.X().ClearButton())
)
)
.SelectionModel(
Html.X().CheckboxSelectionModel()
.Mode(SelectionMode.Multi)
)
)