add filter summary text
This commit is contained in:
@@ -57,7 +57,7 @@ export const TableSettingProvider = ({children}) => {
|
||||
const SummaryTextMessage = (values, columns) => {
|
||||
let SummaryText = "";
|
||||
let HideText = "";
|
||||
let FilterText;
|
||||
let FilterText = "";
|
||||
let SortText = "";
|
||||
|
||||
if (values.sorts && values.sorts.length > 0) {
|
||||
@@ -67,7 +67,17 @@ export const TableSettingProvider = ({children}) => {
|
||||
_list.push(`${_column.header}` + `(${sort.desc ? "نزولی" : "صعودی"})`)
|
||||
}
|
||||
if (_list.length > 0)
|
||||
SortText = " مرتب شده بر اساس " + _list.join(", ")
|
||||
SortText = " مرتب شده بر اساس : " + _list.join(", ")
|
||||
}
|
||||
if (values.filters && values.filters.length > 0){
|
||||
const _list = []
|
||||
for (const filter of values.filters){
|
||||
const _column = columns.find(column => column.id == filter.id)
|
||||
_list.push(`${_column.header}`)
|
||||
}
|
||||
console.log(_list)
|
||||
if (_list.length > 0)
|
||||
FilterText = " فیلتر شده بر اساس : " + _list.join(", ")
|
||||
}
|
||||
|
||||
if (values.hides) {
|
||||
@@ -84,15 +94,24 @@ export const TableSettingProvider = ({children}) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (HideText || SortText) {
|
||||
if (HideText || SortText || FilterText) {
|
||||
if (SortText) {
|
||||
SummaryText += SortText;
|
||||
if (HideText) {
|
||||
SummaryText += " ; ";
|
||||
}
|
||||
if (FilterText){
|
||||
SummaryText += " ; ";
|
||||
}
|
||||
}
|
||||
if (HideText) {
|
||||
SummaryText += HideText;
|
||||
if (FilterText) {
|
||||
SummaryText += " ; ";
|
||||
}
|
||||
}
|
||||
if (FilterText){
|
||||
SummaryText += FilterText
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user