some fix regarding multi-select
This commit is contained in:
parent
3806e44945
commit
f4cec5c48f
@ -18,12 +18,12 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="hasLabelTemplate">
|
<ng-container *ngIf="hasLabelTemplate">
|
||||||
<ng-template ng-label-tmp let-item="item" let-index="index">
|
<ng-template ng-label-tmp let-item="item" let-index="index" let-clear="clear">
|
||||||
<ng-container [ngTemplateOutlet]="selectLabelTemplate"
|
<span class="ng-value-label">
|
||||||
[ngTemplateOutletContext]="{
|
<ng-container [ngTemplateOutlet]="selectLabelTemplate"
|
||||||
$implicit: item,
|
[ngTemplateOutletContext]="{ $implicit: item, index: index, clear: clear }"></ng-container>
|
||||||
index: index
|
</span>
|
||||||
}"></ng-container>
|
<span class="ng-value-icon right" (click)="clear(item)" aria-hidden="true">×</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-select>
|
</ng-select>
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import { Directive, TemplateRef } from '@angular/core';
|
import { Directive, TemplateRef, Input } from '@angular/core';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[psNgSelectLabel]'
|
selector: '[psNgSelectLabel]'
|
||||||
})
|
})
|
||||||
export class SelectLabelTemplateDirective {
|
export class SelectLabelTemplateDirective {
|
||||||
|
|
||||||
constructor(public template: TemplateRef<any>) { }
|
constructor(public template: TemplateRef<any>) { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
:host .flex-container{
|
:host .flex-container{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: baseline;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host .flex-item{
|
:host .flex-item{
|
||||||
margin-right: 1px;
|
margin-right: 1px;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
@ -29,7 +29,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-10" style="padding-top: 5px">
|
<div class="col-lg-10" style="padding-top: 5px;">
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<ng-container psDataGridCol="id">
|
<ng-container psDataGridCol="id">
|
||||||
<div *psDataGridColHeader>ID</div>
|
<ng-container *psDataGridColHeader>ID</ng-container>
|
||||||
<psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="id"></psbx-ds-text-filter>
|
<psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="id"></psbx-ds-text-filter>
|
||||||
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="id"></psbx-grid-sorting>
|
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="id"></psbx-grid-sorting>
|
||||||
<div *psDataGridCell="let model">{{model.id}}</div>
|
<ng-container *psDataGridCell="let model">{{model.id}}</ng-container>
|
||||||
<!--<psbx-number-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="id"></psbx-number-filter>-->
|
<!--<psbx-number-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="id"></psbx-number-filter>-->
|
||||||
<!--<psbx-grid-sorting *psDataGridColSort path="id" [dataSource]="merchantDataSource"></psbx-grid-sorting>-->
|
<!--<psbx-grid-sorting *psDataGridColSort path="id" [dataSource]="merchantDataSource"></psbx-grid-sorting>-->
|
||||||
<!-- <psfa-ds-sort-icon *psDataGridColSort [sortPath]="id" [dataSource]="merchantDataSource">
|
<!-- <psfa-ds-sort-icon *psDataGridColSort [sortPath]="id" [dataSource]="merchantDataSource">
|
||||||
@ -31,31 +31,31 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container psDataGridCol="name">
|
<ng-container psDataGridCol="name">
|
||||||
<div *psDataGridColHeader>Name</div>
|
<ng-container *psDataGridColHeader>Name</ng-container>
|
||||||
<psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="name"></psbx-ds-text-filter>
|
<psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="name"></psbx-ds-text-filter>
|
||||||
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="name"></psbx-grid-sorting>
|
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="name"></psbx-grid-sorting>
|
||||||
<div *psDataGridCell="let model">{{model.name}}</div>
|
<ng-container *psDataGridCell="let model">{{model.name}}</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container psDataGridCol="address">
|
<ng-container psDataGridCol="address">
|
||||||
<div *psDataGridColHeader>Address</div>
|
<ng-container *psDataGridColHeader>Address</ng-container>
|
||||||
<div *psDataGridCell="let model">{{model.address}}</div>
|
<ng-container *psDataGridCell="let model">{{model.address}}</ng-container>
|
||||||
<psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="address">
|
<psbx-ds-text-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="address">
|
||||||
</psbx-ds-text-filter>
|
</psbx-ds-text-filter>
|
||||||
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="address"></psbx-grid-sorting>
|
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="address"></psbx-grid-sorting>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container psDataGridCol="ordering">
|
<ng-container psDataGridCol="ordering">
|
||||||
<div *psDataGridColHeader>Priority</div>
|
<ng-container *psDataGridColHeader>Priority</ng-container>
|
||||||
<div *psDataGridCell="let model">{{model.ordering}}</div>
|
<ng-container *psDataGridCell="let model">{{model.ordering}}</ng-container>
|
||||||
<psbx-number-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="ordering">
|
<psbx-number-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="ordering">
|
||||||
</psbx-number-filter>
|
</psbx-number-filter>
|
||||||
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="ordering"></psbx-grid-sorting>
|
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="ordering"></psbx-grid-sorting>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container psDataGridCol="openDate">
|
<ng-container psDataGridCol="openDate">
|
||||||
<div *psDataGridColHeader>Open Date</div>
|
<ng-container *psDataGridColHeader>Open Date</ng-container>
|
||||||
<div *psDataGridCell="let model">{{model.openDate}}</div>
|
<ng-container *psDataGridCell="let model">{{model.openDate}}</ng-container>
|
||||||
<psbx-datetime-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="openDate">
|
<psbx-datetime-filter *psDataGridCellFilter [dataSource]="merchantDataSource" path="openDate">
|
||||||
</psbx-datetime-filter>
|
</psbx-datetime-filter>
|
||||||
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="openDate"></psbx-grid-sorting>
|
<psbx-grid-sorting *psDataGridColSort [dataSource]="merchantDataSource" path="openDate"></psbx-grid-sorting>
|
||||||
@ -64,12 +64,15 @@
|
|||||||
<ng-container psDataGridCol="commands">
|
<ng-container psDataGridCol="commands">
|
||||||
<ng-container *psDataGridColHeader>Actions</ng-container>
|
<ng-container *psDataGridColHeader>Actions</ng-container>
|
||||||
<ng-container *psDataGridCell="let model">
|
<ng-container *psDataGridCell="let model">
|
||||||
<button class="btn-info btn" psbxCommandModal [commandTitle]="'Change ' + model.name + ' name'"
|
<div class="btn-group">
|
||||||
|
<button class="btn-info btn" psbxCommandModal [commandTitle]="'Change ' + model.name + ' name'"
|
||||||
commandText="Update" [dataSource]="merchantDataSource" command="changeMerchant" [model]="model"
|
commandText="Update" [dataSource]="merchantDataSource" command="changeMerchant" [model]="model"
|
||||||
[template]="theModal">Change</button>
|
[template]="theModal">Change</button>
|
||||||
<button class="btn-danger btn" psbxConfirmModal
|
<button class="btn-danger btn" psbxConfirmModal
|
||||||
[commandTitle]="'Are you sure you wnat to remove ' + model.name + '?'" commandText="Remove"
|
[commandTitle]="'Are you sure you wnat to remove ' + model.name + '?'" commandText="Remove"
|
||||||
[dataSource]="merchantDataSource" command="removeMerchant" [model]="model">Remove</button>
|
[dataSource]="merchantDataSource" command="removeMerchant" [model]="model">Remove</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *psDataGridFooter>
|
<ng-container *psDataGridFooter>
|
||||||
|
@ -24,10 +24,16 @@ selected: {{ myForm.value | json }}
|
|||||||
<img src="assets/32x32-blue.png"><span>Name: </span>{{ item.name }} - <span> Address: </span>{{item.address }}
|
<img src="assets/32x32-blue.png"><span>Name: </span>{{ item.name }} - <span> Address: </span>{{item.address }}
|
||||||
</div>
|
</div>
|
||||||
</ps-ng-select>
|
</ps-ng-select>
|
||||||
|
selected: {{ myValue3 | json }}
|
||||||
|
|
||||||
<h2>Multi-Select Demo</h2>
|
<h2>Multi-Select Demo</h2>
|
||||||
<ps-ng-multi-select [dataSource]="merchantDataSource4" bindLabel="name" bindValue="id" [serverFiltering]="true" [(ngModel)]="myValue4" >
|
<ps-ng-multi-select [dataSource]="merchantDataSource4" bindLabel="name" bindValue="id" [serverFiltering]="true" [(ngModel)]="myValue4" >
|
||||||
|
<div *psNgSelectOption="let item">
|
||||||
|
<img src="assets/32x32-blue.png"><span>Name: </span>{{ item.name }} - <span> Address: </span>{{item.address }}
|
||||||
|
</div>
|
||||||
|
<ng-container *psNgSelectLabel="let item;">
|
||||||
|
{{ item.name }}
|
||||||
|
</ng-container>
|
||||||
</ps-ng-multi-select>
|
</ps-ng-multi-select>
|
||||||
selected: {{ myValue | json }}
|
selected: {{ myValue4 | json }}
|
||||||
|
|
||||||
|
@ -20,11 +20,12 @@ export class NgSelectDemoComponent implements OnInit {
|
|||||||
merchantDataSource4: IDataSource<IMerchant>;
|
merchantDataSource4: IDataSource<IMerchant>;
|
||||||
|
|
||||||
selectedValue: IMerchant;
|
selectedValue: IMerchant;
|
||||||
selectedValue2: IMerchant;
|
|
||||||
selectedValue3: IMerchant;
|
|
||||||
selectedValue4: IMerchant;
|
|
||||||
myForm: FormGroup;
|
myForm: FormGroup;
|
||||||
myValue: string;
|
myValue: string;
|
||||||
|
myValue2: string;
|
||||||
|
myValue3: string;
|
||||||
|
myValue4: string;
|
||||||
|
|
||||||
constructor(private merchantService: MerchantService, private fb: FormBuilder
|
constructor(private merchantService: MerchantService, private fb: FormBuilder
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user