Author Topic: filter options using key-value pair data  (Read 2897 times)

gtwangi

  • Newbie
  • *
  • Posts: 9
    • View Profile
filter options using key-value pair data
« on: January 07, 2019, 07:12:31 pm »
When using KEY-VALUE pair data on filter options as below, inputting keywords in text box on filter popup searches KEY instead of VALUE.
Could I make it find VALUE?

...
filter : {
  crules:[{condition: "equal"}],
  options: [{k1:"AAA"},{k2:"BBB"},{k3:"CCC"}]
}
...
« Last Edit: January 07, 2019, 07:15:43 pm by gtwangi »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6318
    • View Profile
Re: filter options using key-value pair data
« Reply #1 on: January 09, 2019, 11:10:41 am »
Yes it can be done by providing mapping between key value pairs by adding format callback to the column.

gtwangi

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: filter options using key-value pair data
« Reply #2 on: January 14, 2019, 07:31:14 pm »
I tried to add format option on my code, but I couldn't resolve this issue.
Would you please give me a simple example?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6318
    • View Profile
Re: filter options using key-value pair data
« Reply #3 on: January 17, 2019, 08:30:41 pm »
There are couple of examples on usage of column.format in the demos filter section.

Could you post a jsfiddle/ plnkr of your attempt, that would provide an insight of what you are trying to do.