PDA

View Full Version : Where is the TriggerField class?



bogc
Apr 18, 2016, 6:45 AM
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

fabricio.murta
Apr 18, 2016, 6:29 PM
Hello!

All functionality of TriggerField 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 (http://examples4.ext.net/#/Form/Triggers/Overview/)

Hope this helps!

MOHAMMEDRAFI
Apr 12, 2018, 9:52 AM
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.



@{
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();";
})
)
)

fabricio.murta
Apr 24, 2018, 8:15 PM
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: http://examples2.ext.net/#/Form/TriggerField/Overview/
- v4 trigger field: http://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!