|
OnActionComplete(args)
{
console.log(args.result);
} |
|
OnClick(e)
{
this.comboBoj.dataSource = null;
} |
|
onOpen(args)
{
this.comboBoj.dataSource = this.data1;
} |
|
OnClick(e)
{
this.comboBoj.value = null;
this.comboBoj.dataSource = [];
this.comboBoj.dataBind();
} |
|
public object GetData()
{
List<Countries> Data = new Countries().CountriesList();
dynamic count = Data.Count;
return new
{
result = Data,
count = count
};
} |
|
OnActionBegin(e){
this.startTime = new Date().getTime();
}
OnActionComplete(args) {
this.endTime = new Date().getTime();
console.log(args.result);
console.log("API returing time:" + ((this.endTime - this.startTime)/1000))
}
|
|
onbeforeOpen(args){
this.comboBoj.dataSource=new DataManager({
adaptor: new CustomAdaptor(),
crossDomain: true
});
}
|
|
<div class="control-section">
<div style="margin: 0px auto; width:250px; padding-top: 40px;">
<form [formGroup]="skillForm" novalidate id="formId">
<ejs-combobox #sample id='country' formControlName="combo" [dataSource]='data' [fields]='fields' [popupHeight]='height'
[placeholder]='watermark' (open)="onOpen($event)" (beforeOpen)="onbeforeOpen($event)" [query]='query'
(actionBegin)="OnActionBegin($event)" (actionComplete)="OnActionComplete($event)" (change)="onChange($event)">
<ng-template #itemTemplate let-data>
<div>
<span class="name"> {{data.Name}} </span>
<span class="code"> {{data.Code}} </span>
</div>
</ng-template>
</ejs-combobox>
<input type="button" value="ClearDataSource" (click)="OnClick($event)">
</form>
</div>
</div>
|
|
createForm(): void {
this.skillForm = this.fb.group({
combo: ['', Validators.required]
});
}
onbeforeOpen(args){
this.comboBoj.dataSource=new DataManager({
adaptor: new CustomAdaptor(),
crossDomain: true
});
setTimeout(()=>{
this.skillForm.setValue({
combo:'1'
})
},100)
}
|
|
<ejs-combobox #city id='country1' formControlName="city" [dataSource]='data' [fields]='fields' [popupHeight]='height'
[placeholder]='watermark' (beforeOpen)="onbeforeOpen1($event)" [query]='query1' (actionBegin)="OnActionBegin($event)">
<ng-template #itemTemplate let-data>
<div>
<span class="name"> {{data.Name}} </span>
<span class="code"> {{data.Code}} </span>
</div>
</ng-template>
<ng-template #noRecordsTemplate>
<span class='norecord'> Please enter party name first</span>
</ng-template>
</ejs-combobox> |
|
OnActionBegin(e)
{
if (this.partyObj.value)
{
e.query = new Query().take(0)
}
else if (!this.partyObj.value)
{
e.cancel = false;
}
} |
Hello Team,
Thanks for your reply and solution. Your given solution work perfectly but not able to fulfill my all of the requirements.
Since 1 Year I am unable to create satisfactory module with the help of Syncfusion Combo Box which I have seen in Microsoft DevOps Azure Application. I am trying to create same combo box.
1. A Combo box must be fetch data from API only in case of user touch it. Either by typing or by mouse click
2. Combo box also will get predefined single record in oninit, that should be bind and selected. Required when user is editing any master record. Does not want to send any request to API. API will provide Single - single record at the time of page load for all 10 combo box implemented in particular page. Programmatically bind single record (JSON data) without API call
3. When User Click on Cross Button (X), Combo box will clear the selected record and send request to API for fresh new data.
4. Every time When User touch the combo box will generate the new URL with latest query string parameters. All Parameters will fetch selected id from other combo box (Cascading Style).
5.There should be multi column template used in the combo box
6. There should be textbox on each column, so that use can also search by other columns, like in grid
7. Popup should not close when user click in column text box
8. User can able to resize row template column like wise in grid.
9. Prompt Message "Poor Connection" if API does not return any data within 5 seconds,
10. Show Selected Record with All Record In Popup (with Blue Color) (After Selecting any record will show only a single record in the popup)
11. API will return the next 15 Record after scroll (Request to API for next 15 records in scroll event) and append to the existing data
12. Implemented with WebMethodAdoptor
13. Fetch New Fresh Record from API Call After Filtering of Any Text
14. Reactive Form should be implemented because, out the combo box. There is standard service in my application that will patch value to form with the help of form.patchValue
15. When we are clearing combobox through patch value than blank row is adding in combobox