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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DropDown cascading doesn't work with UrlAdaptor

Thread ID:

Created:

Updated:

Platform:

Replies:

129633 Mar 27,2017 07:50 AM UTC Apr 3,2017 04:37 AM UTC ASP.NET MVC 3
loading
Tags: DropDownList
Manolo
Asked On March 27, 2017 07:50 AM UTC

Hi,

I bind dropdownlist with Url adaptor, but cascading doesn't work. If I bind with viewbag, it works.

I attach an example

Attachment: DropDownExample_5558f77b.zip

Karthikeyan Viswanathan [Syncfusion]
Replied On March 28, 2017 10:47 AM UTC

Hi Manolo,   
     
Thanks for contacting Syncfusion support.      
  
In URL databinding, data request will be raised to server based on the query it will return the data but, assigned viewbag data is a local data. Local data query processed internally and it will be shown in the data for corresponding item. In URL databinding, you should execute the query based on the parent dropdown list selection.   
 
Please refer to the code snippet:  
<code>  
@Html.EJ().DropDownList("groupsList2").Datasource(ds => ds.URL(@Url.Content("~") +"Dropdownlist/GetGroupsJson").Adaptor(AdaptorType.UrlAdaptor)).DropDownListFields(f => f.Value("parentId").Text("text")).CascadeTo("countryList2").EnableRTL(false).ClientSideEvents(obj => obj.Cascade("dropcascade"))  
</code>  
<code>  
<script type="text/javascript">  
    function dropcascade(args) {  
        args.cascadeQuery = ej.Query().where(args.model.fields.value, "==", args.cascadeValue);  
}  
</script>  
</code>  
<code>  
        public JsonResult GetCountriesJson(Syncfusion.JavaScript.DataManager dm)  
        {  
            Syncfusion.JavaScript.DataSources.DataOperations operation = newSyncfusion.JavaScript.DataSources.DataOperations();  
            return Json(operation.Execute(GetCountries(), dm));  
        }  
</code>  
           
         
Regards,          
Karthikeyan V. 


Manolo
Replied On March 31, 2017 11:08 AM UTC

Thanks!

Karthikeyan Viswanathan [Syncfusion]
Replied On April 3, 2017 04:37 AM UTC

Hi Manolo,    
 
Thanks for the update.  
 
We are glad the suggestion helped you to achieve your requirement.  
 
Please let us know if you need further assistance.  
 
Regards,   
Karthikeyan V. 


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.

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

;