[CLOSED] Filter Remotely on Displayed Value

  1. #1

    [CLOSED] Filter Remotely on Displayed Value

    Hey Guys,

    I've got a small problem! I have a grid in which I takes in int values then I use a custom renderers to display what that value means. The problem I have is I'm trying to filter the grid remotely because I use remote paging (I have loads of records and don't want to bring them all down) and I want to allow the users to type in the rendered value not the actual value but I can't get it to work, I get errors because its expecting a int32 and getting a string. I have looked at local filtering with js (which works) but this is no use as it only filters the 20 records which I've pulled into the store.

    Thanks Again
    Last edited by Daniil; Mar 13, 2012 at 3:48 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please clarify where exactly are you getting the error? Could you provide a sample to reproduce?
  3. #3
    Hi Daniil,

    Thanks for the reply. I'm getting the error in the back end. I can show the code that I used to get it working when using local filtering

    here it is


    var cnf = function (filter, record) {
        var filterValue = filter.getValue();
    
        if (filterValue.length == 0) {
            return true;
        }
        var values = filterValue.toLowerCase().split(",");
        for (var i = 0; i < values.length; i++) {
            if (clientNameRenderer(record.data.ClientAccountId).toLowerCase().indexOf(values[i].trim()) != -1) {
                applicationDataGridPanel.getSelectionModel().selectFirstRow();
                return true;
            }
        }
        return false;
    }
    And the the filter looked like this.

    <ext:StringFilter DataIndex="ClientAccountId" >
      <validateRecord handler="return cnf(this, record)" />
    </ext:StringFIlter>
    This works but I'm trying to do the same but with remote filtering.

    Thanks
  4. #4
    Well, yes, you can't use ValidateRecord for remote filtering.

    Just to clarify: in remote filtering case GridFilters values are sent to server and you can't get them this way (if you deal with code behind):
    string s = e.Parameters[this.GridFilters1.ParamPrefix];
    Then you can filter a data as you wish according to these filters values.

    In addition, it's not necessary to use the FilterConditions class:
    FilterConditions fc = new FilterConditions(s);
    if a error happens in that class.

    You could extend/override/change that class or just create a new one which would suite your needs.
  5. #5
    Hi Danill,

    Thanks for the guidelines, i've now got it working great. So you can mark this as closed.

    Thanks again

Similar Threads

  1. Remote filter for Header Filter
    By huzzy143 in forum 1.x Help
    Replies: 2
    Last Post: May 09, 2012, 3:43 PM
  2. Replies: 2
    Last Post: May 01, 2012, 4:57 PM
  3. Replies: 1
    Last Post: Mar 19, 2012, 1:54 PM
  4. [CLOSED] Missing filter column using MultiHeader Filter.
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 12, 2010, 1:07 PM
  5. Replies: 0
    Last Post: Mar 05, 2010, 3:28 AM

Tags for this Thread

Posting Permissions