[CLOSED] Toolbar and events on form fields

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Toolbar and events on form fields

    Hello support team,
    I use the following toolbar configuration based on the scenario suggested in post 284071:

    @{
        Layout = null;
        var X = Html.X();
    
        Toolbar toolbar = new Toolbar()
        {
            Border = false,
            Dock = Dock.Top,
            EnableOverflow = true,
            OverflowHandler = OverflowHandler.Menu
        };
    
        toolbar.Plugins.Add(new BoxReorderer());
        toolbar.LayoutConfig.Add(new HBoxLayoutConfig() { Align = HBoxAlign.Stretch });
    
        ButtonGroup grpSave = new ButtonGroup { Title = "Save" };
    
        grpSave.LayoutConfig.Add(new HBoxLayoutConfig() { Align = HBoxAlign.Stretch });
    
        grpSave.Items.Add(new Button { Icon = Icon.Disk, IconAlign = IconAlign.Top, Text = "Save" });
        grpSave.Items.Add(new Button { Icon = Icon.DiskEdit, IconAlign = IconAlign.Top, Text = "Save+New" });
        grpSave.Items.Add(new Button { Icon = Icon.DiskError, IconAlign = IconAlign.Top, Text = "Save+Close" });
    
        ButtonGroup grpOutput = new ButtonGroup { Title = "Output" };
    
        grpOutput.Items.Add(new Button { Icon = Icon.Printer, IconAlign = IconAlign.Top, Text = "Print" });
        grpOutput.Items.Add(new Button { Icon = Icon.Layout, IconAlign = IconAlign.Top, Text = "Preview" });
    
        toolbar.Items.Add(grpSave);
        toolbar.Items.Add(grpOutput);
        toolbar.Items.Add(new ToolbarFill());
    }
    
    @(X.ResourceManager())
    
    @(
        X.Window().Width(400).Height(200)
            .DockedItems(toolbar)
            .Items(
                X.FormPanel().Border(false).PaddingSpec("5 0 0 5")
                    .Items(
                        X.TextField().FieldLabel("Label 1").Listeners(l => l.Blur.Handler = "console.log('BLUR_1')").AutoFocus(true),
                        X.TextField().FieldLabel("Label 2").Listeners(l => l.Blur.Handler = "console.log('BLUR_2')")
                    )
            )
    )
    Mentioned design works perfectly with one problem - clicking the button in the Save group or on the ToolbarFill, it does not trigger a blur event on the input fields. Please try the following:

    1. Code unchanged - blur event is triggered only after clicking on buttons in the Output group.

    2. Comment out grpSave.LayoutConfig - the blur event is fired on both toolbar groups but still not on ToolbarFill.

    3. Put grpSave.LayoutConfig back into the game and comment out the BoxReorderer plugin - everything works as expected.

    I definitely need LayoutConfig settings for toolbar groups, so in the worst case I can sacrifice the plug-in to make it work.

    But why is it behaves this way and is there any work-around to preserve all the features and still be able to capture blur events on the input fields?

    Thank you for your assistance.

    Kind regards
    Dan
    Last edited by fabricio.murta; Aug 26, 2019 at 7:18 PM.

Similar Threads

  1. Grouping form fields
    By atze187 in forum 2.x Help
    Replies: 10
    Last Post: Sep 09, 2014, 8:15 AM
  2. [CLOSED] Mouse events interacting with Ext.Menu fields
    By FVNoel in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 06, 2013, 9:27 AM
  3. [CLOSED] paging toolbar events
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 05, 2013, 4:52 AM
  4. Replies: 1
    Last Post: Aug 02, 2011, 12:59 PM
  5. Replies: 6
    Last Post: May 19, 2011, 9:36 AM

Posting Permissions