forked from CITKParus/P8-Panels
WEBAPP: P8PDataGrid - инициализация списка открытых групп при монтировании, необязательность "reloading"
This commit is contained in:
parent
aca423f16e
commit
40242dedd4
@ -44,7 +44,7 @@ const P8PDataGrid = ({
|
||||
fixedHeader = false,
|
||||
fixedColumns = 0,
|
||||
morePages = false,
|
||||
reloading,
|
||||
reloading = false,
|
||||
expandable,
|
||||
orderAscMenuItemCaption,
|
||||
orderDescMenuItemCaption,
|
||||
@ -162,7 +162,7 @@ P8PDataGrid.propTypes = {
|
||||
fixedHeader: PropTypes.bool,
|
||||
fixedColumns: PropTypes.number,
|
||||
morePages: PropTypes.bool,
|
||||
reloading: PropTypes.bool.isRequired,
|
||||
reloading: PropTypes.bool,
|
||||
expandable: PropTypes.bool,
|
||||
orderAscMenuItemCaption: PropTypes.string.isRequired,
|
||||
orderDescMenuItemCaption: PropTypes.string.isRequired,
|
||||
|
@ -118,7 +118,9 @@ const STYLES = {
|
||||
},
|
||||
TABLE_CELL_EXPAND_CONTAINER: {
|
||||
paddingBottom: 0,
|
||||
paddingTop: 0
|
||||
paddingTop: 0,
|
||||
paddingLeft: 0,
|
||||
paddingRight: 0
|
||||
},
|
||||
TABLE_CELL_GROUP_HEADER: {
|
||||
backgroundColor: "lightgray"
|
||||
@ -495,7 +497,7 @@ const P8PTable = ({
|
||||
fixedHeader = false,
|
||||
fixedColumns = 0,
|
||||
morePages = false,
|
||||
reloading,
|
||||
reloading = false,
|
||||
expandable,
|
||||
orderAscMenuItemCaption,
|
||||
orderDescMenuItemCaption,
|
||||
@ -531,7 +533,9 @@ const P8PTable = ({
|
||||
const [expanded, setExpanded] = useState({});
|
||||
|
||||
//Собственное состояния - развёрнутые группы
|
||||
const [expandedGroups, setExpandedGroups] = useState({});
|
||||
const [expandedGroups, setExpandedGroups] = useState(
|
||||
Array.isArray(groups) && groups.length > 0 ? Object.assign({}, ...groups.map(g => ({ [g.name]: g.expanded }))) : {}
|
||||
);
|
||||
|
||||
//Собственное состояние - колонка с отображаемой подсказкой
|
||||
const [displayHintColumn, setDisplayHintColumn] = useState(null);
|
||||
@ -931,7 +935,7 @@ P8PTable.propTypes = {
|
||||
fixedHeader: PropTypes.bool,
|
||||
fixedColumns: PropTypes.number,
|
||||
morePages: PropTypes.bool,
|
||||
reloading: PropTypes.bool.isRequired,
|
||||
reloading: PropTypes.bool,
|
||||
expandable: PropTypes.bool,
|
||||
orderAscMenuItemCaption: PropTypes.string.isRequired,
|
||||
orderDescMenuItemCaption: PropTypes.string.isRequired,
|
||||
|
Loading…
x
Reference in New Issue
Block a user