We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

do not showing data in autoComplete

Thread ID:

Created:

Updated:

Platform:

Replies:

149700 Dec 6,2019 12:11 AM UTC Dec 9,2019 04:28 AM UTC Blazor 3
loading
Tags: AutoComplete
ebi torabi
Asked On December 6, 2019 12:11 AM UTC

 <EjsAutoComplete ID="CommerceDrugIderer" @ref="CommerceDrugAutoCompelet" @bind-Value="@SelectedDrug" ShowClearButton="true" SortOrder="Syncfusion.EJ2.Blazor.Lists.SortOrder.Ascending" TValue="string" Placeholder="حداقل سه حرف از نام دارو را وارد کنید" FloatLabelType="FloatLabelType.Auto" DataSource="@CommerceDrugsNameList"  EnableRtl="true">
                   <AutoCompleteEvents TValue="string" ValueChange="OnDrugSelect" Filtering="@CommerceDrugsNameFilter"></AutoCompleteEvents>
                    <AutoCompleteFieldSettings Value="Name"  ></AutoCompleteFieldSettings>
                </EjsAutoComplete>


 public async Task CommerceDrugsNameFilter(Syncfusion.EJ2.Blazor.DropDowns.FilteringEventArgs args)

    {

        
        if (args.Text.Length > 2)
        {
            CommerceDrugsNameList = await http.GetJsonAsync<List<NameId>> ($"api/CommerceDrugsName/GetNameIdByNameFiltering/{args.Text}");
            //CommerceDrugAutoCompelet.DataSource = CommerceDrugsNameList;
            //CommerceDrugAutoCompelet.DataBind();
            CommerceDrugAutoCompelet.Filter(CommerceDrugsNameList);

            u = CommerceDrugsNameList.Count().ToString();
        }
        else if (args.Text.Length == 0)
        {
            args.Cancel = true;
            CommerceDrugsNameList.Clear();
            CommerceDrugsNameList = null;
            //CommerceDrugAutoCompelet.Filter(CommerceDrugsNameList);
            //CommerceDrugAutoCompelet.Clear();
        }
        StateHasChanged();

    }



Saranya Dhayalan [Syncfusion]
Replied On December 6, 2019 09:05 AM UTC

Hi Ebi, 
 
Thank you for contacting Syncfusion support 
 
We have checked your reported issue. Please set args. PreventDefaultAction is true in filtering event. Please remove the Datasource from the component. Please find the following code snippet: 
@using Syncfusion.EJ2.Blazor.DropDowns; 
@using BlazorApp1.Data; 
@inject WeatherForecastService ForecastService 
 
<EjsAutoComplete ID="CommerceDrugIderer" @ref="CommerceDrugAutoCompelet" @bind-Value="@SelectedDrug" ShowClearButton="true" SortOrder="Syncfusion.EJ2.Blazor.Lists.SortOrder.Ascending" TValue="string" Placeholder="حداقل سه حرف از نام دارو را وارد کنید" EnableRtl="true"> 
    <AutoCompleteEvents TValue="string" ValueChange="OnDrugSelect" Filtering="@CommerceDrugsNameFilter"></AutoCompleteEvents> 
    <AutoCompleteFieldSettings  Value="CommerceDrugsId" Text="CommerceDrugsName"></AutoCompleteFieldSettings> 
</EjsAutoComplete> 
 
@code{ 
 
    EjsAutoComplete<string> CommerceDrugAutoCompelet; 
 
    private List<NameId> CommerceDrugsNameList = null; 
 
    public string SelectedDrug { get; set; } 
 
    public async Task CommerceDrugsNameFilter(Syncfusion.EJ2.Blazor.DropDowns.FilteringEventArgs args) 
    { 
        if (args.Text.Length > 2) 
        { 
            args.PreventDefaultAction = true; 
            CommerceDrugAutoCompelet.Filter(await ForecastService.getData()); 
           var u = CommerceDrugsNameList.Count().ToString(); 
        } 
        else if (args.Text.Length == 0) 
        { 
            args.Cancel = true; 
            CommerceDrugsNameList.Clear(); 
            CommerceDrugsNameList = null; 
        } 
    } 
 
   public void OnDrugSelect() 
    { 
 
    } 
} 
 
For your convenience we have prepared a sample. Please find the below link: 
 
 
Could you please check the above snippets and get back to us if you need further assistance on this? 
 
Regards, 
Saranya D 


ebi torabi
Replied On December 6, 2019 05:22 PM UTC

Hi Saranya D .Thanks a lot


Saranya Dhayalan [Syncfusion]
Replied On December 9, 2019 04:28 AM UTC

Hi Ebi 
 
Most Welcome.  
 
Please let us know, if you need any further assistance on this.  
 
Regards, 
Saranya D 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon