fixed that when you empty the search it gets back the records.
This commit is contained in:
parent
3d02e19bd1
commit
4ccba42b18
@ -115,9 +115,10 @@ export class MultiSelectComponent implements OnInit,OnDestroy {
|
||||
}
|
||||
|
||||
refreshDataSource(searchTerm: any = null, page: number = null, pageSize: number = null) {
|
||||
let searchfilters:ISimpleFilter[] = null;
|
||||
if(searchTerm)
|
||||
{
|
||||
let searchfilters: ISimpleFilter[] = [];
|
||||
if (searchTerm == "")
|
||||
searchTerm = null;
|
||||
if (searchTerm) {
|
||||
if (this.searchPath) {
|
||||
if (Array.isArray(this.searchPath)) {
|
||||
searchfilters = this.searchPath.map(path => {
|
||||
@ -155,7 +156,6 @@ export class MultiSelectComponent implements OnInit,OnDestroy {
|
||||
sorts = [<ISort>{ path: this.sortingPath || this.bindLabel, ascending: true }];
|
||||
}
|
||||
|
||||
|
||||
this.dataSource.query({
|
||||
page: page,
|
||||
pageSize: pageSize,
|
||||
|
@ -124,9 +124,11 @@ export class NgSelectComponent implements OnInit,OnDestroy {
|
||||
}
|
||||
|
||||
refreshDataSource(searchTerm: any = null, page: number = null, pageSize: number = null) {
|
||||
let searchfilters:ISimpleFilter[] = null;
|
||||
if(searchTerm)
|
||||
{
|
||||
let searchfilters: ISimpleFilter[] = [];
|
||||
if (searchTerm == "")
|
||||
searchTerm = null;
|
||||
|
||||
if (searchTerm) {
|
||||
if (this.searchPath) {
|
||||
if (Array.isArray(this.searchPath)) {
|
||||
searchfilters = this.searchPath.map(path => {
|
||||
|
@ -75,7 +75,7 @@ selected: {{ myValue3 | json }}
|
||||
selected: {{ myValue2 | json }}
|
||||
|
||||
<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" sortingPath="name" [searchPath]="['name', 'address']" 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>
|
||||
|
Loading…
Reference in New Issue
Block a user