@azrico/reactgrid 1.3.22 → 1.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/views/DataGrid.js +11 -10
- package/package.json +1 -1
- package/src/views/DataGrid.tsx +3 -4
|
@@ -291,17 +291,18 @@ function DataGridSearchWrapper(props) {
|
|
|
291
291
|
const visibleColumns = props.gridRef.current.visibleColumns;
|
|
292
292
|
const columns_to_search = (0, _object.array_intersection)(props.advancedFilterFields || [], visibleColumns.map(r => r.id));
|
|
293
293
|
const lowerSearchText = currentSearch.current.toLowerCase().trim();
|
|
294
|
-
console.log('cols:', columns_to_search);
|
|
295
|
-
console.log('currentDS.current:', currentDS.current);
|
|
296
294
|
console.log('s:', lowerSearchText);
|
|
297
|
-
if (!lowerSearchText) newData = currentDS.current;else
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
295
|
+
if (!lowerSearchText) newData = currentDS.current;else {
|
|
296
|
+
newData = currentDS.current.filter(p => {
|
|
297
|
+
for (let index = 0; index < columns_to_search.length; index++) {
|
|
298
|
+
const col = columns_to_search[index];
|
|
299
|
+
const v = (p[col] + '').toLowerCase(); //value of column
|
|
300
|
+
console.log('v:', v);
|
|
301
|
+
if (v && v.indexOf(lowerSearchText) == -1) return false;
|
|
302
|
+
}
|
|
303
|
+
return true;
|
|
304
|
+
});
|
|
305
|
+
}
|
|
305
306
|
} else newData = currentDS.current;
|
|
306
307
|
console.log('newData:', newData.length);
|
|
307
308
|
set_filteredData(newData);
|
package/package.json
CHANGED
package/src/views/DataGrid.tsx
CHANGED
|
@@ -455,20 +455,19 @@ function DataGridSearchWrapper(props: DataGridWrapperProps) {
|
|
|
455
455
|
visibleColumns.map((r) => r.id)
|
|
456
456
|
);
|
|
457
457
|
const lowerSearchText = currentSearch.current.toLowerCase().trim();
|
|
458
|
-
console.log('cols:', columns_to_search);
|
|
459
|
-
console.log('currentDS.current:', currentDS.current);
|
|
460
458
|
console.log('s:', lowerSearchText);
|
|
461
459
|
if (!lowerSearchText) newData = currentDS.current;
|
|
462
|
-
else
|
|
460
|
+
else {
|
|
463
461
|
newData = currentDS.current.filter((p) => {
|
|
464
462
|
for (let index = 0; index < columns_to_search.length; index++) {
|
|
465
463
|
const col = columns_to_search[index];
|
|
466
464
|
const v = (p[col] + '').toLowerCase(); //value of column
|
|
467
|
-
|
|
465
|
+
console.log('v:', v);
|
|
468
466
|
if (v && v.indexOf(lowerSearchText) == -1) return false;
|
|
469
467
|
}
|
|
470
468
|
return true;
|
|
471
469
|
});
|
|
470
|
+
}
|
|
472
471
|
} else newData = currentDS.current;
|
|
473
472
|
console.log('newData:', newData.length);
|
|
474
473
|
|