Author Topic: filter->conditions compare to use other data  (Read 246 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
filter->conditions compare to use other data
« on: November 27, 2023, 08:28:09 pm »
In the "compare" I only have access to (cellData, val1, val2), however I need to also take into account data in other other columns as my filter column is rendered using multiple data sources.

How can I do this, besides completing the column data externally.

Code: [Select]
filter: {
    conditions: {
        range: {
            compare: function(cellData, val1, val2) {
                // need to access ui here to get other column data
            }
        }
    }
}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: filter->conditions compare to use other data
« Reply #1 on: November 27, 2023, 09:14:23 pm »
Quote
however I need to also take into account data in other other columns as my filter column is rendered using multiple data sources.

column.render callback is incorrect choice to update cell value.

Please use rowTemplate getter or js formulas to set up dependencies of a column value on other column values.

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Re: filter->conditions compare to use other data
« Reply #2 on: November 28, 2023, 05:59:16 pm »
This won't work as we build the contents using live and changing data that is shared between tables. 

Also for speed improvements we have turned off spread sheet functions due to the number of rows, as well as other reasons.

Also the help for rowTemplate has no details or examples.
« Last Edit: November 28, 2023, 06:00:55 pm by jplevene »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: filter->conditions compare to use other data
« Reply #3 on: November 28, 2023, 06:23:18 pm »
js formulas are different from spreadsheet functions.

Following are the examples for js functions and rowTemplate respectively:

https://paramquery.com/pro/demos/grid_formula

https://paramquery.com/pro/demos/rowtemplate