WEBAPP: P8PDataGrid - инициализация списка открытых групп при монтировании, необязательность "reloading"
This commit is contained in:
parent
aca423f16e
commit
40242dedd4
@ -44,7 +44,7 @@ const P8PDataGrid = ({
|
|||||||
fixedHeader = false,
|
fixedHeader = false,
|
||||||
fixedColumns = 0,
|
fixedColumns = 0,
|
||||||
morePages = false,
|
morePages = false,
|
||||||
reloading,
|
reloading = false,
|
||||||
expandable,
|
expandable,
|
||||||
orderAscMenuItemCaption,
|
orderAscMenuItemCaption,
|
||||||
orderDescMenuItemCaption,
|
orderDescMenuItemCaption,
|
||||||
@ -162,7 +162,7 @@ P8PDataGrid.propTypes = {
|
|||||||
fixedHeader: PropTypes.bool,
|
fixedHeader: PropTypes.bool,
|
||||||
fixedColumns: PropTypes.number,
|
fixedColumns: PropTypes.number,
|
||||||
morePages: PropTypes.bool,
|
morePages: PropTypes.bool,
|
||||||
reloading: PropTypes.bool.isRequired,
|
reloading: PropTypes.bool,
|
||||||
expandable: PropTypes.bool,
|
expandable: PropTypes.bool,
|
||||||
orderAscMenuItemCaption: PropTypes.string.isRequired,
|
orderAscMenuItemCaption: PropTypes.string.isRequired,
|
||||||
orderDescMenuItemCaption: PropTypes.string.isRequired,
|
orderDescMenuItemCaption: PropTypes.string.isRequired,
|
||||||
|
@ -118,7 +118,9 @@ const STYLES = {
|
|||||||
},
|
},
|
||||||
TABLE_CELL_EXPAND_CONTAINER: {
|
TABLE_CELL_EXPAND_CONTAINER: {
|
||||||
paddingBottom: 0,
|
paddingBottom: 0,
|
||||||
paddingTop: 0
|
paddingTop: 0,
|
||||||
|
paddingLeft: 0,
|
||||||
|
paddingRight: 0
|
||||||
},
|
},
|
||||||
TABLE_CELL_GROUP_HEADER: {
|
TABLE_CELL_GROUP_HEADER: {
|
||||||
backgroundColor: "lightgray"
|
backgroundColor: "lightgray"
|
||||||
@ -495,7 +497,7 @@ const P8PTable = ({
|
|||||||
fixedHeader = false,
|
fixedHeader = false,
|
||||||
fixedColumns = 0,
|
fixedColumns = 0,
|
||||||
morePages = false,
|
morePages = false,
|
||||||
reloading,
|
reloading = false,
|
||||||
expandable,
|
expandable,
|
||||||
orderAscMenuItemCaption,
|
orderAscMenuItemCaption,
|
||||||
orderDescMenuItemCaption,
|
orderDescMenuItemCaption,
|
||||||
@ -531,7 +533,9 @@ const P8PTable = ({
|
|||||||
const [expanded, setExpanded] = useState({});
|
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);
|
const [displayHintColumn, setDisplayHintColumn] = useState(null);
|
||||||
@ -931,7 +935,7 @@ P8PTable.propTypes = {
|
|||||||
fixedHeader: PropTypes.bool,
|
fixedHeader: PropTypes.bool,
|
||||||
fixedColumns: PropTypes.number,
|
fixedColumns: PropTypes.number,
|
||||||
morePages: PropTypes.bool,
|
morePages: PropTypes.bool,
|
||||||
reloading: PropTypes.bool.isRequired,
|
reloading: PropTypes.bool,
|
||||||
expandable: PropTypes.bool,
|
expandable: PropTypes.bool,
|
||||||
orderAscMenuItemCaption: PropTypes.string.isRequired,
|
orderAscMenuItemCaption: PropTypes.string.isRequired,
|
||||||
orderDescMenuItemCaption: PropTypes.string.isRequired,
|
orderDescMenuItemCaption: PropTypes.string.isRequired,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user