Hi IG, I am using MVC helper for cascading combos, and my child combo looks like this:
@(Html.Infragistics().Combo("subTaskDropdown", this.Model)
.ValueKey("Id")
.TextKey("Name")
.DataSourceUrl("subtask-combo-data")
.DataBind()
.FilteringType(ComboFilteringType.Local)
.RenderMatchItemsCondition(ComboRenderMatchItemsCondition.Contains)
.FilteringCondition("contains")
.CaseSensitive(false)
.AutoComplete(false)
.DropDownWidth(250)
.Width("250")
.CascadingSettings(settings => settings.ParentComboID("#taskDropdown").ParentComboKey("TaskId"))
.AddClientEvent("filtered", "subtaskFiltered")
.AddClientEvent("selectionChanged", "subtaskSelectionChanged")
.NullText("Select SubTask:")
.ItemTemplate("<span class='ComboText'>${Name}</span>")
.Render()
)
After selecting a value in this combo I open partial view with detail, where I update datasource for the combo on button click using ajax, something like this:
function SaveEXTask() {
$.ajax({
url:'/ETL/SaveSubtask',
data: $('#Form1').serializeArray(),
type:'POST',
success:function(data)....
My question is - what would be the correct way to refresh/rebind combo after underlying source has been updated in my case?
Thanks
Hi Nikolay Sitnikov,
You need to rebound the igCombo.
In your success callback you need to change the dataSource something like this:
$("subTaskDropdown").igCombo("option", "dataSource", newDataSource);
This should change the dataSource and rebind the combo.
Thanks,
Thanks, Todor!