[CLOSED] Hide the default arrow trigger

  1. #1

    [CLOSED] Hide the default arrow trigger

    Hi Community !

    Hi, I have a combobox which also has some custom trigger. I need hide the default arrow trigger, when the fields is clean through

    
    FormPanel1.Reset();
    It doesn't work

    
    ComboBox1.HideBaseTrigger = true;
    ComboBox1.HideTrigger = true;
    I implemented the following example to illustrate my issue, I accept suggestions ideas or comments

    
    <%@ Page Language="C#" AutoEventWireup="true" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
    
                Store1.DataSource = new object[]
                        {
                            new {Text = "One", Value = 1},
                            new {Text = "Two", Value = 2},
                            new {Text = "Three", Value = 3},
                            new {Text = "Four", Value = 4},
                            new {Text = "Five", Value = 5},
                        };
                Store1.DataBind();
            }
        }
        protected void Button1_Click(object sender, DirectEventArgs e)
        {
            //ComboBox1.HideBaseTrigger = true;
            //ComboBox1.HideTrigger = true;
            
            FormPanel1.Reset();
            
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head id="Head1" runat="server">
        <title>Edit Form View - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            
            <ext:Window ID="FormWindow" runat="server" 
                Title="Form View" 
                Width="440" 
                Height="310"           
                BodyPadding="15" 
                Resizable="false" 
                Closable="false"
                Layout="Fit">
                <Items>
                    <ext:FormPanel ID="FormPanel1" runat="server" 
                            Border="false" 
                            Layout="Form">
                        <Items>
                            <ext:ComboBox ID="ComboBox1" runat="server"
                                    Name="Name4" 
                                    MsgTarget="Side" 
                                    AllowBlank="false"
                                    ValueField="Value"    
                                    DisplayField="Text"
                                    EmptyText="Seleccionar Number..." 
                                    FieldLabel="Field ComboBox1" >
                                <Store>
                                    <ext:Store ID="Store1" runat="server" AutoLoad="false" >               
                                        <Model>
                                            <ext:Model ID="Model1" runat="server">
                                                <Fields>
                                                    <ext:ModelField Name="Value"/>
                                                    <ext:ModelField Name="Text" />
                                                </Fields>
                                            </ext:Model>
                                        </Model>
                                    </ext:Store>
                                </Store>
                                <Triggers>
                                    <ext:FieldTrigger Icon="Clear" HideTrigger="true" Qtip="Limpia Selección" />
                                </Triggers>
                                <Listeners>
                                    <BeforeQuery Handler="this.getTrigger(0)[this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                                    <Select Handler="this.getTrigger(0).show();" />
                                    <TriggerClick Handler="if (index == 0) 
                                                                        { 
                                                                            this.clearValue();
                                                                            this.getTrigger(0).hide();
                                                                        }
                                                                        "/>
                                </Listeners>
                            </ext:ComboBox>
                        </Items>
                    </ext:FormPanel>
                </Items>
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:Button ID="Button1" runat="server" Icon="Erase" Text="Clear ComboBox 1">
                                
                                <DirectEvents>
                                    <Click OnEvent="Button1_Click"></Click>
                                </DirectEvents>
                                
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                
            </ext:Window>
        </form>
    </body>
    </html>
    I accept suggestions ideas or comments

    Regards.
    Last edited by Daniil; Sep 17, 2015 at 3:31 PM. Reason: [CLOSED]
  2. #2
    Hi @opendat2000,

    I need hide the default arrow trigger
    In my understanding of your requirement you rather need to hide the custom clear trigger, don't you? To revert the ComboBox to the initial state as it is at page load before any user interactions.

    Anyways, this hides the arrow trigger:
    protected void Button1_Click(object sender, DirectEventArgs e)
    {
        ComboBox1.HideBaseTrigger = true;
        FormPanel1.Reset();
    }
    And this hides the clear trigger:
    protected void Button1_Click(object sender, DirectEventArgs e)
    {
        this.ComboBox1.Call("getTrigger(0).hide");
        this.FormPanel1.Reset();
    }
  3. #3
    Hi Daniil,

    Thanks a lot for your reply, the code line you proposed worked perfectly.

    
    this.ComboBox1.Call("getTrigger(0).hide");
    Please close the thread.

    Saludos

    Mauricio.

Similar Threads

  1. [CLOSED] Hide arrow from NumberField
    By matrixwebtech in forum 2.x Premium Help
    Replies: 2
    Last Post: Aug 04, 2014, 10:18 AM
  2. Replies: 4
    Last Post: Dec 02, 2010, 1:44 PM
  3. [CLOSED] DatePicker: hide or disable previous and next arrow
    By RomualdAwessou in forum 1.x Premium Help
    Replies: 3
    Last Post: Sep 15, 2010, 2:43 PM
  4. [CLOSED] [1.0] TriggerField default trigger
    By randy85253 in forum 1.x Premium Help
    Replies: 5
    Last Post: Feb 22, 2010, 6:06 AM
  5. Replies: 2
    Last Post: May 31, 2009, 11:28 PM

Posting Permissions