Not working prepopulation of data in multiselect

Hi,
for prepolating data in MultiSelect i have used value property of multiselect.
but the problem is whenever i am giving [mode] propery as 'box'.it is not showing the prepopulated value.
if i am deleting [mode] property of multiselect.then it is coming.
could you please give the example how would i populate preselected value.
here,i am giving code that i have tried.please let me know if i have done any mistake.
app.component.html:
[fields]='fields' [placeholder]='placeholder' [query]='query'[mode]='marketBox'
[sortOrder]='sorting'[allowCustomValue]='true'>
app.component.ts
import { Component, ViewChild } from '@angular/core';
import { DataManager, ODataV4Adaptor, Query } from '@syncfusion/ej2-data';
import { MultiSelectComponent } from '@syncfusion/ej2-ng-dropdowns';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
@ViewChild('multiselectelement')
public multiselectcomp: MultiSelectComponent;
public marketBox: string ;
public data: DataManager = new DataManager({
url: 'http://services.odata.org/V4/Northwind/Northwind.svc/',
adaptor: new ODataV4Adaptor,
crossDomain: true
});
constructor() {
// this.marketBox = 'box';
}
public fields: Object = { text: 'ContactName', value: 'CustomerID' };
public query: Query = new Query().from('Customers').select(['ContactName', 'CustomerID']).take(5);
public placeholder: string = 'Select customers';
public sorting: string = 'Ascending';
tick() {
console.log(this.multiselectcomp);
this.multiselectcomp.value = ['ALFKI'];
}
}
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { MultiSelectComponent } from '@syncfusion/ej2-ng-dropdowns';
@NgModule({
declarations: [
AppComponent,
MultiSelectComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

3 Replies

GG Gopi Govindasamy Syncfusion Team February 5, 2018 12:47 PM UTC

Hi Prangya,   
  
Thanks for using Syncfusion EJ2 components.   
  
We have confirmed (“Multiselect preselect value not working in remote data”) as a issue in multiselect. We will include the fix in the upcoming release Vol1 2018. which will be rolled out by mid of February. We will let you know once it is rolled out   
  
Regards,   
Gopi G 



PT Prangya Tiwari February 5, 2018 01:47 PM UTC

Hi,
Thank you for the update.


GG Gopi Govindasamy Syncfusion Team February 6, 2018 01:09 PM UTC

Hi Prangya,  

Most Welcome. Please get back to us if you require any further assistance on this  

Regards,  
Gopi G. 


Loader.
Up arrow icon