vn table now receives show buttons options
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
11f24372e5
commit
04a31f4cff
|
@ -2,7 +2,7 @@
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<div class="actions-left">
|
<div class="actions-left">
|
||||||
<vn-button icon="view_column"
|
<vn-button icon="view_column"
|
||||||
ng-if="$ctrl.viewConfigId"
|
ng-if="$ctrl.options.activeButtons.shownColumns"
|
||||||
ng-click="smartTableColumns.show($event)"
|
ng-click="smartTableColumns.show($event)"
|
||||||
vn-tooltip="Shown columns">
|
vn-tooltip="Shown columns">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
|
@ -10,10 +10,12 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="actions-right">
|
<div class="actions-right">
|
||||||
<vn-button icon="search"
|
<vn-button icon="search"
|
||||||
|
ng-if="$ctrl.options.activeButtons.search"
|
||||||
ng-click="$ctrl.displaySearch()"
|
ng-click="$ctrl.displaySearch()"
|
||||||
vn-tooltip="Search">
|
vn-tooltip="Search">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
<div class="button-group">
|
<div class="button-group"
|
||||||
|
ng-if="$ctrl.options.activeButtons.crud">
|
||||||
<vn-button icon="add"
|
<vn-button icon="add"
|
||||||
ng-click="$ctrl.createRow()"
|
ng-click="$ctrl.createRow()"
|
||||||
vn-tooltip="Add new row">
|
vn-tooltip="Add new row">
|
||||||
|
@ -32,16 +34,10 @@
|
||||||
vn-tooltip="Save data">
|
vn-tooltip="Save data">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-group">
|
|
||||||
<vn-button icon="refresh"
|
<vn-button icon="refresh"
|
||||||
ng-click="$ctrl.model.refresh()"
|
ng-click="$ctrl.model.refresh()"
|
||||||
vn-tooltip="Refresh">
|
vn-tooltip="Refresh">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
<vn-button icon="more_vert"
|
|
||||||
ng-click="moreOptions.show($event)"
|
|
||||||
vn-tooltip="More">
|
|
||||||
</vn-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
|
|
||||||
|
@ -62,6 +58,7 @@
|
||||||
</vn-confirm>
|
</vn-confirm>
|
||||||
|
|
||||||
<vn-crud-model
|
<vn-crud-model
|
||||||
|
ng-if="$ctrl.viewConfigId"
|
||||||
vn-id="userViewModel"
|
vn-id="userViewModel"
|
||||||
url="UserConfigViews"
|
url="UserConfigViews"
|
||||||
link="{tableCode: $ctrl.viewConfigId, userFk: $ctrl.currentUserId}"
|
link="{tableCode: $ctrl.viewConfigId, userFk: $ctrl.currentUserId}"
|
||||||
|
|
|
@ -15,6 +15,20 @@ export default class SmartTable extends Component {
|
||||||
this.autoSave = false;
|
this.autoSave = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get options() {
|
||||||
|
return this._options;
|
||||||
|
}
|
||||||
|
|
||||||
|
set options(options) {
|
||||||
|
this._options = options;
|
||||||
|
if (!options) return;
|
||||||
|
|
||||||
|
const activeButtons = options.activeButtons;
|
||||||
|
const missingId = activeButtons && activeButtons.shownColumns && !this.viewConfigId;
|
||||||
|
if (missingId)
|
||||||
|
throw new Error('vnSmartTable: View identifier not defined');
|
||||||
|
}
|
||||||
|
|
||||||
get model() {
|
get model() {
|
||||||
return this._model;
|
return this._model;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
<vn-auto-search
|
<vn-auto-search
|
||||||
model="model">
|
model="model">
|
||||||
</vn-auto-search>
|
</vn-auto-search>
|
||||||
<!-- <vn-crud-model auto-load="true"
|
|
||||||
vn-id="model"
|
|
||||||
url="Tickets"
|
|
||||||
limit="20"
|
|
||||||
order="id DESC">
|
|
||||||
</vn-crud-model> -->
|
|
||||||
<vn-card>
|
<vn-card>
|
||||||
<!-- To access table component should be a nested component -->
|
|
||||||
<smart-table
|
<smart-table
|
||||||
model="model"
|
model="model"
|
||||||
view-config-id="ticketIndex"
|
view-config-id="ticketIndex"
|
||||||
|
@ -16,22 +9,6 @@
|
||||||
auto-save="true"
|
auto-save="true"
|
||||||
expr-builder="$ctrl.exprBuilder(param, value)"
|
expr-builder="$ctrl.exprBuilder(param, value)"
|
||||||
default-new-data="$ctrl.defaultNewData()">
|
default-new-data="$ctrl.defaultNewData()">
|
||||||
<slot-actions>
|
|
||||||
<vn-button icon="info"
|
|
||||||
ng-click="$ctrl.test()"
|
|
||||||
vn-tooltip="Info">
|
|
||||||
</vn-button>
|
|
||||||
<div class="button-group">
|
|
||||||
<vn-button icon="info"
|
|
||||||
ng-click="$ctrl.test()"
|
|
||||||
vn-tooltip="Info">
|
|
||||||
</vn-button>
|
|
||||||
<vn-button icon="info"
|
|
||||||
ng-click="$ctrl.test()"
|
|
||||||
vn-tooltip="Info">
|
|
||||||
</vn-button>
|
|
||||||
</div>
|
|
||||||
</slot-actions>
|
|
||||||
<slot-table>
|
<slot-table>
|
||||||
<table class="vn-table">
|
<table class="vn-table">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
|
@ -8,6 +8,11 @@ export default class Controller extends Section {
|
||||||
super($element, $);
|
super($element, $);
|
||||||
this.vnReport = vnReport;
|
this.vnReport = vnReport;
|
||||||
this.smartTableOptions = {
|
this.smartTableOptions = {
|
||||||
|
activeButtons: {
|
||||||
|
search: true,
|
||||||
|
crud: true,
|
||||||
|
shownColumns: true,
|
||||||
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
field: 'salesPersonFk',
|
field: 'salesPersonFk',
|
||||||
|
|
Loading…
Reference in New Issue