1. #1
    Ext User
    Join Date
    Dec 2009
    Posts
    4
    Vote Rating
    0
    kamil.schvarcz is on a distinguished road

      0  

    Default ux.grid.GridFilters local - filter on rendered column

    ux.grid.GridFilters local - filter on rendered column


    Hi all,

    I try to use ux.grid.GridFilters type String for column with renderer ux.renderer.Combo for show and edit foreign table data, but validateRecord function is build only for value (in my implementation ID) and not for displayed value. In this function its available only record object, but there is no information about renderer value.

    Have somebody idea how can I compare this rendered value?

    Thanks for any response.

    Kamil

  2. #2
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Midwest, USA
    Posts
    96
    Vote Rating
    2
    Reimius is on a distinguished road

      0  

    Default


    If you always want the rendered value to be what's compared, here's the solution.

    Use Ext.override on the Ext.ux.grid.filter.StringFilter object, specifically on validateRecord function, copy that function into the override and then change the line:
    var val = record.get(this.dataIndex);

    into:
    var val = yourRenderFunction(record.get(this.dataIndex));

    where yourRenderFunction is whatever function you are using to render the data.

    If you don't always want this to be the case, add an extra option to the config and then check for it in this function using the same override method above, and do the checks for filtering based on this conditionional logic instead.

    Make sure to include your function within the override call.

Thread Participants: 1

Tags for this Thread