[OPEN] [#1195] PagingToolbar's input item has a clear trigger

  1. #1

    [OPEN] [#1195] PagingToolbar's input item has a clear trigger

    In the following example, PagingToolbar's input item has a clear trigger, what in my opinion it shouldn't have.

    Thanks in advance.
    Click image for larger version. 

Name:	ii001.png 
Views:	9 
Size:	2.7 KB 
ID:	24366
    <!DOCTYPE html>
    <html>
    <head runat="server">
    </head>
    <body>
        <ext:ResourceManager Theme="Crisp" ScriptMode="Debug" runat="server" />
        <ext:GridPanel Title="Ext.NET" Border="true" Width="400" Height="280" runat="server">
            <BottomBar>
                <ext:PagingToolbar InputItemWidth="100" runat="server" />
            </BottomBar>
            <Store>
                <ext:Store AutoLoad="true" runat="server">
                    <Proxy>
                        <ext:AjaxProxy Url="~/Example/LoadFakeRecords/">
                            <Reader>
                                <ext:JsonReader RootProperty="data" />
                            </Reader>
                        </ext:AjaxProxy>
                    </Proxy>
                    <Model>
                        <ext:Model IDProperty="ID" runat="server">
                            <Fields>
                                <ext:ModelField Name="ID" Type="String" />
                                <ext:ModelField Name="Name" Type="String" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column Text="ID" DataIndex="ID" runat="server" />
                    <ext:Column Text="Name" Flex="1" DataIndex="Name" runat="server" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
    </body>
    </html>
    namespace SandBox.Controllers
    {
        public class ExampleController : System.Web.Mvc.Controller
        {
            public ActionResult Index() => View();
    
            public StoreResult LoadFakeRecords()
            {
                List<Entity> lst = new List<Entity>();
    
                for (int index = 0; index < 5; index++)
                {
                    lst.Add(new Entity
                    {
                        ID = index,
                        Name = $"Name - {index}",
                    });
                }
                return new StoreResult(lst, lst.Count());
            }
        }
    
        public class Entity
        {
            public int ID { get; set; }
    
            public string Name { get; set; }
        }
    }
    Last edited by Daniil; Dec 19, 2015 at 12:54 PM. Reason: [OPEN] [#1195]
  2. #2
    It's possible to overcome the issue presented above by overriding Ext.toolbar.Paging.getPagingItems, as shown below.

    Daniil, what is your opinion about that?

    <!DOCTYPE html>
    <html>
    <head runat="server">
        <script type="text/javascript">
            Ext.toolbar.Paging.override({
                getPagingItems: function () {
                    debugger;
                    var items = this.callParent(arguments);
    
                    for (var index = 0; index < items.length; index++) {
                        var item = items[index];
                        if (item.itemId == 'inputItem') {
                            item.removeClearTrigger = true;
                            break;
                        }
                    }
                    return items;
                }
            });
        </script>
    </head>
    <body>
        <ext:ResourceManager Theme="Crisp" ScriptMode="Debug" runat="server" />
        <ext:GridPanel Title="Ext.NET" Border="true" Width="400" Height="280" runat="server">
            <BottomBar>
                <ext:PagingToolbar InputItemWidth="100" runat="server" />
            </BottomBar>
            <Store>
                <ext:Store AutoLoad="true" runat="server">
                    <Proxy>
                        <ext:AjaxProxy Url="~/Example/LoadFakeRecords/">
                            <Reader>
                                <ext:JsonReader RootProperty="data" />
                            </Reader>
                        </ext:AjaxProxy>
                    </Proxy>
                    <Model>
                        <ext:Model IDProperty="ID" runat="server">
                            <Fields>
                                <ext:ModelField Name="ID" Type="String" />
                                <ext:ModelField Name="Name" Type="String" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column Text="ID" DataIndex="ID" runat="server" />
                    <ext:Column Text="Name" Flex="1" DataIndex="Name" runat="server" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
    </body>
    </html>
  3. #3
    Hi Raphael,

    Well, it is IE's UI approach. I don't have a solid opinion how it should be. Probably, IE users expect to see this clear trigger for any field. From other side, it should probably look the same in all the browsers. Though, an IE user might ask like "Hey, there is my clear trigger?".

    So, at some point we provided the RemoveClearTrigger and RemoveShowPasswordTrigger options on a TextField.

    I think it would be good to have global RemoveClearTrigger and RemoveShowPasswordTrigger settings on a ResourceManager and they should be true by default. By the way, it is all related to IE only. So, maybe, RemoveIEClearTrigger and RemoveIEShowPasswordTrigger are better names.

    Created a feature Issue:
    https://github.com/extnet/Ext.NET/issues/1195

    For now please use this CSS to turn those triggers off:
    input::-ms-clear
        {
        display: none;
        width : 0;
        height: 0;
    }
    
    input::-ms-reveal {
        display: none;
        width : 0;
        height: 0;
    }
  4. #4
    I think it would be good to have global RemoveClearTrigger and RemoveShowPasswordTrigger settings on a ResourceManager and they should be true by default.
    it would be nice if we could set that config up on Web.config <extnet> Global Configuration Properties.

    By the way, it is all related to IE only. So, maybe, RemoveIEClearTrigger and RemoveIEShowPasswordTrigger are better names.
    I agree.
  5. #5
    Yes, usually a ResourceManager's options reflect to Web.config.

Similar Threads

  1. Replies: 0
    Last Post: Jul 29, 2014, 8:43 AM
  2. [CLOSED] [1.7] Remove IE10 Clear Field trigger
    By lapix in forum 1.x Premium Help
    Replies: 2
    Last Post: Aug 05, 2013, 10:00 AM
  3. Clear RadioGroup checked item
    By chunhuxiao in forum 1.x Help
    Replies: 0
    Last Post: Apr 26, 2012, 7:34 AM
  4. PagingToolbar spacing for Right menu item
    By cwolcott in forum 2.x Help
    Replies: 1
    Last Post: Mar 20, 2012, 7:54 PM
  5. [CLOSED] ComboBox trigger click fails to clear value
    By Ben in forum 1.x Premium Help
    Replies: 2
    Last Post: Nov 02, 2009, 10:51 AM

Posting Permissions