Hello:
I am attempting to upgrade from Ext.Net 2.5 MVC to Ext.Net 4.0 MVC and there is no TriggerField class! Has it been replaced?
Thanks
Printable View
Hello:
I am attempting to upgrade from Ext.Net 2.5 MVC to Ext.Net 4.0 MVC and there is no TriggerField class! Has it been replaced?
Thanks
Hello!
All functionality ofTriggerField
has been moved into [var]TextField[var] since Ext.NET 3.
See the updated example using the feature in Ext.NET 4: Field Triggers - Overview
Hope this helps!
Hello,
We are migrating ext.net 2.5 to ext 4.5.1 with mvc. While migration we are getting error at TriggerField().
Below is the code written for 2.5 which is working fine . After migration giving errors at TriggerField.
Code:@{
var X = Html.X();
ViewBag.Title = "Create Account";
Layout = "~/Views/Shared/_ExtLayout.cshtml";
Ext.Net.StoreParameter PrimayId = new Ext.Net.StoreParameter();
PrimayId.Name = "Id";
PrimayId.Mode = Ext.Net.ParameterMode.Value;
PrimayId.Value = Url.CurrentId();
Ext.Net.StoreParameter TableType = new Ext.Net.StoreParameter();
TableType.Name = "TableType";
TableType.Mode = Ext.Net.ParameterMode.Value;
TableType.Value = Request.QueryString("TableType");
}
<style type="text/css">
.x-grid-td div{
white-space: normal;
}
</style>
@(
X.TreePanel().ID("HistoryTree")
.UseArrows(true)
.RootVisible(false)
.Layout(LayoutType.Fit)
.Height(700)
.ColumnModel(
X.TreeColumn().Text("Label Name").Flex(2).DataIndex("labelName"),
X.Column().Text("Old Val").Flex(1).DataIndex("oldVal"),
X.Column().Text("New Val").Flex(1).DataIndex("newVal")
)
.Store(
X.TreeStore()
.ID("SourceTreeStore")
.AutoLoad(false)
.BuildTreeProxy("~/AjaxData/Getdata")
.Model(
X.Model()
.Fields(fields =>
{
fields.Add(X.ModelField().Name("labelName"));
fields.Add(X.ModelField().Name("oldVal"));
fields.Add(X.ModelField().Name("newVal"));
})
)
.Parameters(param =>
{
param.Add(PrimayId);
param.Add(TableType);
})
)
.TopBarItem(
X.ToolbarTextItem().Text("Search Data:"),
X.ToolbarSpacer(),
X.TriggerField().ID("SearchText")
.Width(200)
.EnableKeyEvents(true)
.Triggers(X.FieldTrigger().Icon(TriggerIcon.Clear))
.Listeners(l =>
{
l.KeyUp.Fn = "filterTree";
l.KeyUp.Buffer = 250;
l.TriggerClick.Fn = "clearFilter";
}),
X.ToolbarSpacer(),
X.Button()
.Text("Expand/Collapse History")
.ID("ExpandCollapseGroupsbutton")
.Icon(Ext.Net.Icon.TableSort)
.Listeners(expanbutton =>
{
expanbutton.Click.Handler = "ExpandAndCollapse();";
})
)
)
Hello again, @MOHAMMEDRAFI!
As stated above, the class has been moved within textfield. Please take a second look at the last post, check the linked sample code, that's how your code should be changed in order to work with recent versions of Ext.NET.
If it does not help much, then see the difference between the Ext.NET v2 and v4 examples:
- v2 trigger field: https://examples2.ext.net/#/Form/TriggerField/Overview/
- v4 trigger field: https://examples4.ext.net/#/Form/Triggers/Overview/
You shouldn't have problems porting this even if that's MVC, just follow the pattern, it should work just fine. If you try to port it and it breaks somehow, please let us know.
Hope this helps!