... | ... | @@ -13,6 +13,7 @@ Entity Grid Panel: |
|
|
* [How to perform deep customization of grid](#how-to-perform-deep-customization-of-grid)
|
|
|
* [How to control availability of actions in grid](#how-to-control-availability-of-actions-in-grid)
|
|
|
* [How to open grid item in tab instead of popup](#how-to-open-grid-item-in-tab-instead-of-popup)
|
|
|
* [How to configure default sort order](#how-to-configure-default-sort-order)
|
|
|
|
|
|
Base Panel:
|
|
|
* [How to add custom buttons into toolbar](#how-to-add-custom-buttons-into-toolbar)
|
... | ... | @@ -304,7 +305,7 @@ In the handler, control the actions: |
|
|
},
|
|
|
```
|
|
|
|
|
|
One advanced subcase of that is control of action availability, basing on ELS. If a user may not to do a server call (no permissions) - it is best to hide an action on client, so that user won't get error messages.
|
|
|
One advanced application of that technique is ELS-driven action availability. If a user is not allowed to do a server call because of no permissions, it is best to hide an action on client, so that user won't get error messages.
|
|
|
|
|
|
In order to do that, use `entity.haveAccessToMethod` function to deterine, if user actually has access to an entity method:
|
|
|
```
|
... | ... | @@ -333,8 +334,24 @@ In order to do that, you need to override method `openForm`, like the following: |
|
|
},
|
|
|
```
|
|
|
|
|
|
It could be done in an inherited compoment, or it could be juse a configuration property of `ubdetailgrid` component.
|
|
|
It could be done in an inherited component, or it could be just a configuration property of `ubdetailgrid` component.
|
|
|
|
|
|
## How to configure default sort order
|
|
|
|
|
|
Do NOT specify `sortList` for the `showList` command, because it will conflict with sort order added to command on click on grid column headers.
|
|
|
Instead specify in shortcut a code like the following one:
|
|
|
```javascript
|
|
|
{
|
|
|
...
|
|
|
cmpInitConfig: {
|
|
|
afterInit: function() {
|
|
|
this.store.sort('myDefaultSortAttr', 'ASC');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
The shortcut is not exactly JSON, it is evaluated as a javascript module, that is why such trick in the shortcut code works.
|
|
|
|
|
|
# Base Panel
|
|
|
|
... | ... | |