Author Topic: Does not filter on the formatted price  (Read 1836 times)

mscodigno

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 24
    • View Profile
Does not filter on the formatted price
« on: April 20, 2021, 01:19:47 pm »
Hello, the price field comes from the database in the format '#. ###, 00'. I cannot use the filtering feature in this column. What should I do?

https://jsfiddle.net/zekeriyaerogluu/kqmzv45u/31/

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Does not filter on the formatted price
« Reply #1 on: April 20, 2021, 10:00:25 pm »
Formatted values can be converted back to numbers with pq.deFormatNumber method.

Code: [Select]
    var dataModel = {
      data: data.map(function(rd){     
        rd.unitePrice = pq.deFormatNumber(rd.unitePrice, "#.###,00");
        return rd;
      })
    };

https://jsfiddle.net/eu5jkphm/

mscodigno

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Does not filter on the formatted price
« Reply #2 on: April 21, 2021, 12:00:33 pm »
1. I want it to appear formatted in the edit box as well. Can i do that?

2. How can I do for remote data?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Does not filter on the formatted price
« Reply #3 on: April 21, 2021, 11:01:57 pm »
1. No

2. Please use dataModel.getData callback.