PrimeNg表过滤器​​“包含”和“等于”不适用于带有空格的字符串

时间:2019-11-30 10:59:01

标签: angular typescript primeng primeng-datatable primeng-treetable

请参阅此链接以获取基本表过滤器代码 primengtable

说我们的 cars 数组将是


    cars: [
        {"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad 23 1ff"},
        {"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwr eg re345"},
        {"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h3 54htr"},
        {"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54 qgh"},
        {"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy 34"},
        {"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejt yj"},
        {"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g4 3gr"},
        {"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "gre g34"},
        {"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54 hw5"},
        {"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245 t2s"}
    ]

我正在尝试将过滤器类型“ 包含”或“ 等于”应用于VIN字段,但由于具有空格而无法过滤。 如何为此应用过滤器?

0 个答案:

没有答案