Where is the TriggerField class?

  1. #1

    Where is the TriggerField class?

    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
    Last edited by bogc; Apr 18, 2016 at 6:48 AM.
  2. #2
    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

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3

    Trigged Field class not working in Ext.net 4.5.1 with MVC

    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();";
                                        })
                )
    )
    Last edited by fabricio.murta; Apr 24, 2018 at 8:09 PM.
  4. #4
    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!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. TriggerField and triggers
    By jurel in forum 1.x Help
    Replies: 1
    Last Post: Aug 31, 2010, 7:45 PM
  2. [1.0] Triggerfield resize
    By SouthDeveloper in forum 1.x Help
    Replies: 3
    Last Post: May 13, 2010, 1:03 PM
  3. [0.8.2] Propertygrid and triggerfield
    By plykkegaard in forum 1.x Help
    Replies: 0
    Last Post: Jan 01, 2010, 5:23 PM
  4. TriggerField Validation
    By erey in forum 1.x Help
    Replies: 0
    Last Post: May 15, 2009, 9:11 PM
  5. TriggerField Use
    By erey in forum 1.x Help
    Replies: 5
    Last Post: May 14, 2009, 4:38 PM

Posting Permissions