我如何使用DataTable中的“ filteredValue”属性来应用自定义过滤?

问题描述 投票:0回答:1

我想使用数据表(PrimeFaces)的“ filteredValue”属性中的“ setter”函数来应用自定义过滤逻辑...问题是,setter函数始终接收空值,如果我使用要过滤的值集合,过滤操作不会反映在数据表中!。

publiv void setFilteredOrg(List filteredOrg) {
       // filteredOrg always null
       // I apply custom filtering against the value
       return the filtered collection but the UI isnt filtered
}

希望我能使自己理解;我担心粘贴代码...但是我可以看看它是否令人困惑...

jsf filter primefaces datatable
1个回答
0
投票
在您的列中,使用filterMatchMode ='custom'和filterFunction ='customFilter'

customFilter是您定义的javascript函数

function customFilter(itemLabel, filterValue) { //return true to accept and false to reject }

© www.soinside.com 2019 - 2024. All rights reserved.