complete sorting and filtering datatable and working with local storage for caching data
This commit is contained in:
@@ -2,10 +2,7 @@ import { parseFromValuesOrFunc } from "@/core/utils/utils";
|
||||
import { Menu } from "@mui/material";
|
||||
import DataTable_ActionMenuItem from "./ActionMenuItem";
|
||||
|
||||
const DataTable_CellActionMenu = ({
|
||||
table,
|
||||
...rest
|
||||
}) => {
|
||||
const DataTable_CellActionMenu = ({ table, ...rest }) => {
|
||||
const {
|
||||
getState,
|
||||
options: {
|
||||
@@ -32,12 +29,11 @@ const DataTable_CellActionMenu = ({
|
||||
};
|
||||
|
||||
const internalMenuItems = [
|
||||
(parseFromValuesOrFunc(enableClickToCopy, cell) === 'context-menu' ||
|
||||
parseFromValuesOrFunc(columnDef.enableClickToCopy, cell) ===
|
||||
'context-menu') && (
|
||||
(parseFromValuesOrFunc(enableClickToCopy, cell) === "context-menu" ||
|
||||
parseFromValuesOrFunc(columnDef.enableClickToCopy, cell) === "context-menu") && (
|
||||
<DataTable_ActionMenuItem
|
||||
icon={<ContentCopy />}
|
||||
key={'mrt-copy'}
|
||||
key={"mrt-copy"}
|
||||
label={localization.copy}
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
@@ -47,10 +43,10 @@ const DataTable_CellActionMenu = ({
|
||||
table={table}
|
||||
/>
|
||||
),
|
||||
parseFromValuesOrFunc(enableEditing, row) && editDisplayMode === 'cell' && (
|
||||
parseFromValuesOrFunc(enableEditing, row) && editDisplayMode === "cell" && (
|
||||
<DataTable_ActionMenuItem
|
||||
icon={<EditIcon />}
|
||||
key={'mrt-edit'}
|
||||
key={"mrt-edit"}
|
||||
label={localization.edit}
|
||||
onClick={() => {
|
||||
openEditingCell({ cell, table });
|
||||
@@ -71,14 +67,13 @@ const DataTable_CellActionMenu = ({
|
||||
};
|
||||
|
||||
const menuItems =
|
||||
columnDef.renderCellActionMenuItems?.(renderActionProps) ??
|
||||
renderCellActionMenuItems?.(renderActionProps);
|
||||
columnDef.renderCellActionMenuItems?.(renderActionProps) ?? renderCellActionMenuItems?.(renderActionProps);
|
||||
|
||||
return (
|
||||
(!!menuItems?.length || !!internalMenuItems?.length) && (
|
||||
<Menu
|
||||
MenuListProps={{
|
||||
dense: density === 'compact',
|
||||
dense: density === "compact",
|
||||
sx: {
|
||||
backgroundColor: menuBackgroundColor,
|
||||
},
|
||||
@@ -95,6 +90,5 @@ const DataTable_CellActionMenu = ({
|
||||
</Menu>
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
export default DataTable_CellActionMenu
|
||||
};
|
||||
export default DataTable_CellActionMenu;
|
||||
|
||||
Reference in New Issue
Block a user