@azrico/reactgrid 1.3.21 → 1.3.22
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.
|
@@ -292,11 +292,12 @@ function DataGridSearchWrapper(props) {
|
|
|
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
294
|
console.log('cols:', columns_to_search);
|
|
295
|
+
console.log('currentDS.current:', currentDS.current);
|
|
295
296
|
console.log('s:', lowerSearchText);
|
|
296
297
|
if (!lowerSearchText) newData = currentDS.current;else newData = currentDS.current.filter(p => {
|
|
297
298
|
for (let index = 0; index < columns_to_search.length; index++) {
|
|
298
299
|
const col = columns_to_search[index];
|
|
299
|
-
const v = (p[col] + '').toLowerCase(); //
|
|
300
|
+
const v = (p[col] + '').toLowerCase(); //value of column
|
|
300
301
|
if (v && v.indexOf(lowerSearchText) == -1) return false;
|
|
301
302
|
}
|
|
302
303
|
return true;
|
|
@@ -307,10 +308,8 @@ function DataGridSearchWrapper(props) {
|
|
|
307
308
|
}, 1000), []);
|
|
308
309
|
_react.default.useEffect(() => {
|
|
309
310
|
set_search('');
|
|
310
|
-
(0, _object.fn_eval)(props.dataSource).then(
|
|
311
|
-
data
|
|
312
|
-
}) => {
|
|
313
|
-
currentDS.current = data;
|
|
311
|
+
(0, _object.fn_eval)(props.dataSource).then(r => {
|
|
312
|
+
currentDS.current = typeof r === 'object' ? r.data || r : r;
|
|
314
313
|
searchIfNeeded();
|
|
315
314
|
});
|
|
316
315
|
}, [props.dataSource]);
|
package/package.json
CHANGED
package/src/views/DataGrid.tsx
CHANGED
|
@@ -456,13 +456,14 @@ function DataGridSearchWrapper(props: DataGridWrapperProps) {
|
|
|
456
456
|
);
|
|
457
457
|
const lowerSearchText = currentSearch.current.toLowerCase().trim();
|
|
458
458
|
console.log('cols:', columns_to_search);
|
|
459
|
+
console.log('currentDS.current:', currentDS.current);
|
|
459
460
|
console.log('s:', lowerSearchText);
|
|
460
461
|
if (!lowerSearchText) newData = currentDS.current;
|
|
461
462
|
else
|
|
462
463
|
newData = currentDS.current.filter((p) => {
|
|
463
464
|
for (let index = 0; index < columns_to_search.length; index++) {
|
|
464
465
|
const col = columns_to_search[index];
|
|
465
|
-
const v = (p[col] + '').toLowerCase(); //
|
|
466
|
+
const v = (p[col] + '').toLowerCase(); //value of column
|
|
466
467
|
|
|
467
468
|
if (v && v.indexOf(lowerSearchText) == -1) return false;
|
|
468
469
|
}
|
|
@@ -477,8 +478,8 @@ function DataGridSearchWrapper(props: DataGridWrapperProps) {
|
|
|
477
478
|
);
|
|
478
479
|
React.useEffect(() => {
|
|
479
480
|
set_search('');
|
|
480
|
-
fn_eval(props.dataSource).then((
|
|
481
|
-
currentDS.current = data;
|
|
481
|
+
fn_eval(props.dataSource).then((r) => {
|
|
482
|
+
currentDS.current = typeof r === 'object' ? r.data || r : r;
|
|
482
483
|
searchIfNeeded();
|
|
483
484
|
});
|
|
484
485
|
}, [props.dataSource]);
|