[CLOSED] Combobox search need help

Page 2 of 2 FirstFirst 12
  1. #11
    hi,

    i find this solution , and it's solved my problem.

    <AutoLoadParams>
                        <ext:Parameter Name="start" Value="0" Mode="Raw" />
                        <ext:Parameter Name="limit" Value="10" Mode="Raw" />
    </AutoLoadParams>
    but i have one other problem, sometimes after filter on combobox, the paging toolbar don't resize correctly, how rezise or disable the scroll ?

    correct size :

    Click image for larger version. 

Name:	taille correcte.jpg 
Views:	86 
Size:	13.1 KB 
ID:	4672

    wrong size :

    Click image for larger version. 

Name:	taille incorrecte.jpg 
Views:	87 
Size:	8.4 KB 
ID:	4673

    thanks for your help.
  2. #12
    Maybe setting up MinHeight for the ComboBox could help.
  3. #13
    hi,

    it's change anything.

    maybe , i need to recreate my paging toolbar ? how got in C# , the paging toolbar of combobox for edit the settings ?
  4. #14
    Please try to call the restrictHeight method for the ComboBox.

    Example
    [DirectMethod]
    public void onKeyUpTry(String filter)
    {
        Store store = this.ComboBox1.GetStore();
        store.Filter("Code", filter, true, false);
        this.ComboBox1.Call("restrictHeight");
    }
  5. #15
    it's works !

    but Now I have duplicates of values that are created when one reaches the minimum size and and it does not properly to indicate the number of page 1/2 etc ....

    maybe, it's possible to edit in this way ?


    <ext:EventStore runat="server">
         <Listeners>
             <BeforeShow Handler="custompaging" />
         </Listeners>
    </ext:EventStore>
    var costuompaging = function ()
    {
         me = this; 
         me.pageTb.onLoad(); 
    }
    or force , the reload of composent in this way ?

    var costuompaging = function ()
    {
     var me = this,
                pageData,
                currPage,
                pageCount,
                afterText;
     pageData = me.getPageData();
            currPage = pageData.currentPage;
            pageCount = pageData.pageCount;
            afterText = Ext.String.format(me.afterPageText, isNaN(pageCount) ? 1 : pageCount);
    
            me.child('#afterTextItem').setText(afterText);
            me.child('#inputItem').setValue(currPage);
            me.child('#first').setDisabled(currPage === 1);
            me.child('#prev').setDisabled(currPage === 1);
            me.child('#next').setDisabled(currPage === pageCount);
            me.child('#last').setDisabled(currPage === pageCount);
            me.child('#refresh').enable();
            me.updateInfo();
            me.fireEvent('change', me, pageData);
    }
    but i'm not sure if it's possible or not. and if i use the right event.

    Thank you.
  6. #16
    Quote Originally Posted by ddslogistics View Post
    but Now I have duplicates of values that are created when one reaches the minimum size and and it does not properly to indicate the number of page 1/2 etc ....
    Please provide a sample to reproduce.

    Also the EventStore has appeared in the thread first time. Please clarify is this problem related to the initial one?
  7. #17
    Hi,

    finally, duplicates were my fault.

    Now all i have fix my problem, I can not say for certain what thing did not work directly but now all works.

    I post the complete solution, if it can help someone :

    what it does :
    - resize,count correctly the pagingToolBar in Local mode

    Page.aspx (combobox mode : Local)
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.ComboBox1.GetStore();
                store.DataSource = new object[]
                {
                    new object[] { "1", "John", "Brown" },
                    new object[] { "2", "Brad", "Gray" },
                    new object[] { "3", "John", "Green" }
                };
                store.DataBind();
            }
        }
    </script>
    
    
          <ext:ComboBox
                ID="ComboBox1"
                runat="server"
                Width="300"
                ValueField="Code"
                ItemSelector="tr.list-item"
                MinChars="1"
                LoadingText="Searching..."
                PageSize="10"
                HideTrigger="true"
                DisplayField="Label"
                Mode="Local">  
                <Store>
                    <ext:Store ID="Store1" runat="server">
                     <AutoLoadParams>
                        <ext:Parameter Name="start" Value="0" Mode="Raw" />
                        <ext:Parameter Name="limit" Value="10" Mode="Raw" />
                     </AutoLoadParams>
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="Code" />
                                    <ext:RecordField Name="Label" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <Template ID="Template1" runat="server">
                    <Html>
                        <tpl for=".">
                            <tpl if="[xindex] == 1">
    			                <table class="cbStates-list">
    			                    <tr>
    			                        <th>Label</th>
                                        <th>Code</th>
                                    </tr>
                            </tpl>
                                <tr class="list-item">
                                    <td>{Label}</td>
    							    <td>{Code}</td>
                                </tr>
                            <tpl if="[xcount-xindex]==0">
    			                </table>
    			            </tpl>
                        </tpl>
                    </Html>
                </Template>
                <Listeners>
                    <KeyUp Handler="Ext.net.DirectMethods.onKeyUpTry(this.getRawValue());costuompaging;" />
                    <Focus Handler="this.pageTb.refresh.hide();" Delay="1" />
                </Listeners>
            </ext:ComboBox>
    Page.aspx.cs
      [DirectMethod]
            public void onKeyUpTry(String _filter)
            {
                        Store1.Filter("Label", _filter, true, false);  
                        this.ComboBox1.Call("restrictHeight");
                        this.ComboBox1.Call("pageTb.onLoad", null, null, new object());    
             }
    Thank you very much for your help and your patience.
    you can close the post.
  8. #18
    Good, thanks for sharing!
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [CLOSED] Sub Search for combobox
    By AnulekhaK in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 19, 2011, 9:31 AM
  2. custom search in combobox
    By aditya.murthy88@gmail.com in forum 1.x Help
    Replies: 0
    Last Post: Feb 05, 2011, 8:57 AM
  3. Combobox live search
    By Yannis in forum 1.x Help
    Replies: 0
    Last Post: Dec 09, 2009, 10:19 AM
  4. ComboBox Custom Search Example
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Aug 15, 2009, 10:59 PM
  5. ComboBox Custom Search example
    By echo in forum 1.x Help
    Replies: 1
    Last Post: Jul 01, 2009, 1:27 PM

Tags for this Thread

Posting Permissions