Commit 3e448d4e authored by Pavel Mashliakovskiy's avatar Pavel Mashliakovskiy 🤹🏻
Browse files

- UTableEntity: new item `filter` can be used in `hideActions` array to hide a filter button

- FullTextSearch result - `filer` action is hidden in toolbar [UBDF-11424]
parent e79edd9c
......@@ -29,7 +29,7 @@ Common `ubql`
### cmdData.columns
array<object|string> of display columns.
If `columns` is unset, will automatically computed from fieldList.
If `columns` is unset, will automatically compute from fieldList.
### cmdData.columns[].format
`format` can be as function or string.
......@@ -37,7 +37,7 @@ In case format function passed as string it will call by `new Function` class.
`format` has next params: `value`, `column`, `row`
### cmdData.entityName
In case passed `entityName` then colmuns and fieldList will compute automatically
If `entityName` is passed, then `columns` and `fieldList` will be computed automatically
```json
{
......@@ -67,19 +67,36 @@ FieldList will compute automatically, but columns manually
"cmdType": "showList",
"cmdData": {
"entityName": "ubm_enum",
"columns": ["eGroup", "code"]
},
scopedSlots: createElement => ({
toolbarAppend: (slotScope) => createElement('button', 'click me'),
eGroup: ({ row }) => createElement(
'u-button',
{
props: {
icon: 'u-icon-send'
}
},
row.ID + row.eGroup
)
})
"columns": ["eGroup", "code"],
scopedSlots: createElement => ({
toolbarAppend: (slotScope) => createElement('button', 'click me'),
eGroup: ({ row }) => createElement(
'u-button',
{
props: {
icon: 'u-icon-send'
}
},
row.ID + row.eGroup
)
})
}
}
```
# Other UTableEntity options
Almost all UTableEntity options can be passed using cmdData. Example below hide "Filter button" and define `buildEditConfig` handler
```javascript
{
cmdType: "showList",
cmdData: {
entityName: "ubm_enum",
columns: ["eGroup", "code"],
hideActions: ['filter'],
buildEditConfig (cfg, row) {
cfg.entity = row.entity
return cfg
}
}
}
```
......@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- UTableEntity: new item `filter` can be used in `hideActions` array to hide a filter button
### Changed
......@@ -14,7 +15,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Removed
### Fixed
- `UDropdownItem`: menu item textbox now expanded to 100% of menu width, this allow to handle click everythere on row, not only on the text [LDOC-1666]
- `UDropdownItem`: menu item textbox now expanded to 100% of menu width, this allows to handle click everythere on row, not only on the text [LDOC-1666]
- FullTextSearch result - `filer` action is hidden in toolbar [UBDF-11424]
## [5.20.26] - 2021-09-24
### Fixed
......
......@@ -62,7 +62,10 @@
name="toolbarAppend"
/>
<filter-selector />
<filter-selector
v-if="showFilter"
>
</filter-selector>
<sort
ref="sort"
:target-column="targetColumn"
......@@ -574,7 +577,8 @@ export default {
'canCreateNewVersion',
'hasDataHistoryMixin',
'showSummary',
'showExport'
'showExport',
'showFilter'
]),
selectedColumnId: {
......
......@@ -203,6 +203,10 @@ module.exports = (instance) => ({
return !instance.hideActions.includes('export')
},
showFilter () {
return !instance.hideActions.includes('filter')
},
columns () {
return instance.getColumns
},
......
......@@ -178,6 +178,7 @@ export default {
target: $App.viewport.centralPanel,
title: this.$ut('fullTextSearchWidgetResultTitle', this.query),
cmdData: {
hideActions: ['filter'],
scopedSlots: h => ({
toolbarDropdownAudit: () => h('div'),
contextMenuAudit: () => h('div')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment