Bug #376 dropdown "more" en ticket.sale no actualiza sus datos
This commit is contained in:
parent
cb34b11b99
commit
48e44bd610
|
@ -26,6 +26,7 @@ export default class IconMenu extends Input {
|
||||||
|
|
||||||
onClick(event) {
|
onClick(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
if (this.onOpen) this.onOpen();
|
||||||
this.showDropDown();
|
this.showDropDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +82,8 @@ ngModule.component('vnIconMenu', {
|
||||||
multiple: '<?',
|
multiple: '<?',
|
||||||
onChange: '&?',
|
onChange: '&?',
|
||||||
icon: '@?',
|
icon: '@?',
|
||||||
translateFields: '<?'
|
translateFields: '<?',
|
||||||
|
onOpen: '&?'
|
||||||
},
|
},
|
||||||
transclude: {
|
transclude: {
|
||||||
tplItem: '?tplItem'
|
tplItem: '?tplItem'
|
||||||
|
|
|
@ -9,6 +9,15 @@ export default class RestModel {
|
||||||
this.clear();
|
this.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set staticData(value) {
|
||||||
|
this._staticData = value;
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
get staticData() {
|
||||||
|
return this._staticData;
|
||||||
|
}
|
||||||
|
|
||||||
get isLoading() {
|
get isLoading() {
|
||||||
return this.canceler != null;
|
return this.canceler != null;
|
||||||
}
|
}
|
||||||
|
@ -48,11 +57,11 @@ export default class RestModel {
|
||||||
|
|
||||||
this.clear();
|
this.clear();
|
||||||
this.sendRequest(filter);
|
this.sendRequest(filter);
|
||||||
} else if (this.staticData) {
|
} else if (this._staticData) {
|
||||||
if (search)
|
if (search)
|
||||||
this.data = this.$filter('filter')(this.staticData, search);
|
this.data = this.$filter('filter')(this._staticData, search);
|
||||||
else
|
else
|
||||||
this.data = this.staticData;
|
this.data = this._staticData;
|
||||||
this.dataChanged();
|
this.dataChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
on-change="$ctrl.onStateChange(value)">
|
on-change="$ctrl.onStateChange(value)">
|
||||||
</vn-icon-menu>
|
</vn-icon-menu>
|
||||||
<vn-icon-menu
|
<vn-icon-menu
|
||||||
|
vn-id="more-button"
|
||||||
label="More"
|
label="More"
|
||||||
show-filter="false"
|
show-filter="false"
|
||||||
value-field="callback"
|
value-field="callback"
|
||||||
data="$ctrl.moreOptions"
|
|
||||||
translate-fields="['name']"
|
translate-fields="['name']"
|
||||||
on-change="$ctrl.onMoreChange(value)"
|
on-change="$ctrl.onMoreChange(value)"
|
||||||
ng-click="$ctrl.onMoreClick()">
|
on-open="$ctrl.onMoreOpen()">
|
||||||
</vn-icon-menu>
|
</vn-icon-menu>
|
||||||
<vn-button
|
<vn-button
|
||||||
disabled="!$ctrl.isChecked || !$ctrl.isEditable"
|
disabled="!$ctrl.isChecked || !$ctrl.isEditable"
|
||||||
|
@ -59,6 +59,8 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="sale in index.model.instances track by sale.id">
|
<tr ng-repeat="sale in index.model.instances track by sale.id">
|
||||||
|
<td><vn-icon ng-show="sale.disponible" icon="icon-reserved"></vn-icon></td>
|
||||||
|
<td><vn-icon ng-show="sale.visible" icon="icon-reserved"></vn-icon></td>
|
||||||
<td><vn-icon ng-show="sale.reserved" icon="icon-reserved"></vn-icon></td>
|
<td><vn-icon ng-show="sale.reserved" icon="icon-reserved"></vn-icon></td>
|
||||||
<td number>
|
<td number>
|
||||||
<vn-check
|
<vn-check
|
||||||
|
@ -76,6 +78,7 @@
|
||||||
<td ng-if="!$ctrl.isEditable" number>{{sale.quantity}}</td>
|
<td ng-if="!$ctrl.isEditable" number>{{sale.quantity}}</td>
|
||||||
<td ng-if="$ctrl.isEditable" number>
|
<td ng-if="$ctrl.isEditable" number>
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
|
|
||||||
model="sale.quantity"
|
model="sale.quantity"
|
||||||
on-change="$ctrl.updateQuantity(sale.id,sale.quantity)"
|
on-change="$ctrl.updateQuantity(sale.id,sale.quantity)"
|
||||||
unclearable="true">
|
unclearable="true">
|
||||||
|
@ -85,7 +88,7 @@
|
||||||
ng-if="$ctrl.isEditable"
|
ng-if="$ctrl.isEditable"
|
||||||
ng-click="$ctrl.showEditPricePopover($event, sale)"
|
ng-click="$ctrl.showEditPricePopover($event, sale)"
|
||||||
pointer
|
pointer
|
||||||
vn-tooltip="Edit Price">
|
vn-tooltip="Edit price">
|
||||||
{{sale.price | currency:'€':2}}
|
{{sale.price | currency:'€':2}}
|
||||||
</td>
|
</td>
|
||||||
<td number ng-if="!$ctrl.isEditable">
|
<td number ng-if="!$ctrl.isEditable">
|
||||||
|
@ -185,7 +188,6 @@
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<div pad-medium>
|
<div pad-medium>
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
vn-focus
|
|
||||||
label="Price"
|
label="Price"
|
||||||
model="$ctrl.editedPrice"
|
model="$ctrl.editedPrice"
|
||||||
type="number"
|
type="number"
|
||||||
|
|
Loading…
Reference in New Issue