@visns-studio/visns-components 2.7.4 → 2.7.5
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/components/crm/DataGrid.jsx +16 -14
- package/package.json +1 -1
|
@@ -372,20 +372,22 @@ const DataGrid = forwardRef(
|
|
|
372
372
|
};
|
|
373
373
|
|
|
374
374
|
const handleSort = (value) => {
|
|
375
|
-
setConfig
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
375
|
+
if ( setConfig ) {
|
|
376
|
+
setConfig((prevState) => {
|
|
377
|
+
const { id, dir } = value || {}; // Destructure id and dir from value (if provided)
|
|
378
|
+
const sortBy = id || null;
|
|
379
|
+
const sort = dir === 1 ? 'asc' : dir === -1 ? 'desc' : null;
|
|
380
|
+
|
|
381
|
+
return {
|
|
382
|
+
...prevState,
|
|
383
|
+
ajaxSetting: {
|
|
384
|
+
...prevState.ajaxSetting,
|
|
385
|
+
sortBy,
|
|
386
|
+
sort,
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
});
|
|
390
|
+
}
|
|
389
391
|
};
|
|
390
392
|
|
|
391
393
|
const onRowClick = useCallback((rowProps, event) => {
|
package/package.json
CHANGED