Filter Grid from Textfield outside of grid?

  1. #1

    Filter Grid from Textfield outside of grid?

    I have a gridpabnel - and a textfield outside of the gridpanel - how do I filter the grid from the textfield and not use the gridfilter input?
  2. #2

    RE: Filter Grid from Textfield outside of grid?

    Please try like this ....

    <ext:TextField ID="searchText" runat="server" Text="" EnableKeyEvents="true">
        <Listeners>
        <KeyUp Fn="searchColumn_KeyUp" />
        </Listeners>
     </ext:TextField>
    
    
    // Javascript ...
    <script language="javascript" type="text/javascript">
    
    function searchColumn_KeyUp()
    {
        var searchString = searchText().getValue().trim();
    
       Store().filterBy(getFilterRecord('userName', searchString)); /Store = Grid Store,  userName = Grid column dataIndex name 
    }
    
    function filterString(value, dataIndex, record)
    {
        var val = record.get(dataIndex);
        if (typeof val != "string")
        {
            return value.length == 0;
        }
        return val.toLowerCase().indexOf(value.toLowerCase()) > -1;
    }
    
    function getFilterRecord(field, searchString)
    {
        var f = [];
    
        f.push({
            filter: function(record)
            {
                return filterString(searchString, field, record);
            }
        });
    
        var len = f.length;
        return function(record)
        {
            for (var i = 0; i < len; i++)
            {
                if (!f[i].filter(record))
                {
                    return false;
                }
            }
            return true;
        };
    }
    
    </script>
    Hope this helps...

  3. #3

    RE: Filter Grid from Textfield outside of grid?

    How can I accomplish the same thing with remote filtering and paging?
  4. #4

    RE: Filter Grid from Textfield outside of grid?



    It would be great if we can get this plugin into Coolite:

    http://extjs.com/forum/showthread.php?t=23615

    It's WAY better than the current grid filters. Most users have trouble finding the current grid filters.
  5. #5

    RE: Filter Grid from Textfield outside of grid?

    It would be great if we can get this plugin into Coolite:


    http://extjs.com/forum/showthread.php?t=23615
    </p>

    Hi Jacky,</p>

    I agree it would be a nice addition, but unfortunately, we're prevented from incorportating the plugin because of licensing restrictions applied by the author.</p>


    </p>
    Geoffrey McGill
    Founder

Similar Threads

  1. Grid Filter Events
    By pfss in forum 1.x Help
    Replies: 3
    Last Post: Feb 07, 2012, 4:38 PM
  2. [CLOSED] Grid Filter
    By majunior in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 22, 2011, 5:09 PM
  3. filter above grid header
    By rnachman in forum 1.x Help
    Replies: 1
    Last Post: Feb 08, 2011, 9:01 PM
  4. Replies: 1
    Last Post: Oct 09, 2009, 3:46 AM
  5. Grid Filter
    By mmiocev in forum 1.x Help
    Replies: 2
    Last Post: Apr 04, 2009, 12:13 PM

Posting Permissions