In my ViewModel I have a List<SelectListItem> and I am using the MVC Extension Html.DropDownListFor to create the <select> element with its child <option> elements.
In javascript, I am turning that into a Kendo DropDownList
I have a second DropDownList constructed in the same way (Html.DropDownListFor & in js, make it a Kendo DDL)
I want to keep the initial page load fast and therefore want to keep the DropDownListFor in place, but I also want to allow the Categories change event to repopulate the Products DDL. I can easily add the change event to the ddCategories DDL, but how can I configure the ddProducts to not load via AJAX on page load, but then to repopulate on the event of ddCategories change? It seems to me you can either do one or the other, but this is not as efficient as I would like.
For example, I will eventually have upwards to 8-10 dropdowns on a single page, all cascading from each other (optionLabel not allowed, so first item will always be selected). If I have them all cascade from each other on page load, that will take way too long (up to 7-9 sequential AJAX calls). Ideally, I would populate them all from the ViewModel on page load and only perform the ajax refresh when the user interacts with the page (other issues with that many cascading drop downs that I will save for a different post once this question is answered)
Thanks,
--Ed
In javascript, I am turning that into a Kendo DropDownList
$('#ddCategories').kendoDropDownList();I have a second DropDownList constructed in the same way (Html.DropDownListFor & in js, make it a Kendo DDL)
$('#ddProducts').kendoDropDownList();I want to keep the initial page load fast and therefore want to keep the DropDownListFor in place, but I also want to allow the Categories change event to repopulate the Products DDL. I can easily add the change event to the ddCategories DDL, but how can I configure the ddProducts to not load via AJAX on page load, but then to repopulate on the event of ddCategories change? It seems to me you can either do one or the other, but this is not as efficient as I would like.
For example, I will eventually have upwards to 8-10 dropdowns on a single page, all cascading from each other (optionLabel not allowed, so first item will always be selected). If I have them all cascade from each other on page load, that will take way too long (up to 7-9 sequential AJAX calls). Ideally, I would populate them all from the ViewModel on page load and only perform the ajax refresh when the user interacts with the page (other issues with that many cascading drop downs that I will save for a different post once this question is answered)
Thanks,
--Ed