My datasource looks correct and the HTML/javascript generated looks fine too, but the child combo box in a cascading set of combo boxes is never showing any data. Not sure what I'm missing. Here is what I have:
@(Html.Infragistics().Combo(groupControl.ControlName, groupControl.ParentControlList)
.ValueKey(
"Parent_Id")
.TextKey(
"Parent_Name")
.DataBind()
.FilteringType(
ComboFilteringType.Local)
.RenderMatchItemsCondition(
ComboRenderMatchItemsCondition.StartsWith)
.FilteringCondition(
"startsWith")
.AutoComplete(
true)
.Disabled(groupControl.ReadOnly)
.SelectedIndexes(Model.ScreenData ==
null || Model.ScreenData.Rows.Count == 0 || string.IsNullOrEmpty(DataManager.GetString(Model.ScreenData.Rows[0], groupControl.FieldName)) ? null : groupControl.SelectedParentControlList)
.ValidatorOptions(m => m.OnBlur(
true).OnChange(false).OnSubmit(true).FormSubmit(true).KeepFocus(ValidatorKeepFocus.Never).ShowIcon(true).Required(groupControl.Required))
.DropDownWidth(175)
.Width(
"175")
.Render())
@:
@(Html.Infragistics().Combo(
"child" + groupControl.ControlName, groupControl.ChildControlList)
"Child_Id")
"Child_Name")
null || Model.ScreenData.Rows.Count == 0 || string.IsNullOrEmpty(DataManager.GetString(Model.ScreenData.Rows[0], groupControl.CascadingFieldName)) ? null : groupControl.SelectedChildControlList)
.CascadingSettings(settings => settings.ParentComboID(groupControl.ControlName).ParentComboKey(
"Parent_Name"))
Here is what gets generated when I view the source on the page - it looks like the combos are getting filled correctly to me but nothing ever shows in the child control (the parent control works fine).
<span id="CARRIER"><input name="CARRIER" type="hidden" /></span><script type="text/javascript">//<!--<![CDATA[
$.ig.loader(
'igCombo', function() {$('#CARRIER').igCombo({ filterExprUrlKey: 'filter', valueKey: 'Parent_Id', textKey: 'Parent_Name', filteringType: 'local', renderMatchItems: 'startswith', filteringCondition: 'startsWith', autoComplete: true, dropDownWidth: 175, width: '175', inputName: 'CARRIER', loadOnDemandSettings: null, dataSource: [{"Parent_Id":"1","Parent_Name":"ABF"},{"Parent_Id":"2","Parent_Name":"CCX"},{"Parent_Id":"3","Parent_Name":"Courier"},{"Parent_Id":"4","Parent_Name":"Customer Pickup"},{"Parent_Id":"5","Parent_Name":"DHL Express"},{"Parent_Id":"6","Parent_Name":"FedEx Express®"},{"Parent_Id":"7","Parent_Name":"FedEx Ground®"},{"Parent_Id":"8","Parent_Name":"FedEx SmartPost®"},{"Parent_Id":"9","Parent_Name":"JB Hunt"},{"Parent_Id":"10","Parent_Name":"R\u0026L"},{"Parent_Id":"11","Parent_Name":"Roadway"},{"Parent_Id":"12","Parent_Name":"UPS"},{"Parent_Id":"13","Parent_Name":"USPS"},{"Parent_Id":"14","Parent_Name":"Yellow"}] });});
//]]>-->
</script><script type='text/javascript'>(function ($) {$(document).ready(function () {var wm = $("#__ig_wm__").length > 0 ? $("#__ig_wm__") : $('<div id="__ig_wm__"></div>').appendTo(document.body);wm.css({position: 'fixed',bottom: 0,right: 0,zIndex: 1000}).addClass('ui-igtrialwatermark');});}(jQuery));</script>
<span id="childCARRIER"><input name="childCARRIER" type="hidden" /></span><script type="text/javascript">//<!--<![CDATA[
function() {$('#childCARRIER').igCombo({ filterExprUrlKey: 'filter', valueKey: 'Child_Id', textKey: 'Child_Name', filteringType: 'local', renderMatchItems: 'startswith', filteringCondition: 'startsWith', autoComplete: true, dropDownWidth: 175, width: '175', parentCombo: 'CARRIER', parentComboKey: 'Parent_Name', inputName: 'childCARRIER', loadOnDemandSettings: null, dataSource: [{"Child_Id":"5","Child_Name":"Global Mail Priority"},{"Child_Id":"5","Child_Name":"Global Mail Standard"},{"Child_Id":"5","Child_Name":"Intl Document Letter"},{"Child_Id":"5","Child_Name":"Intl Document Service"},{"Child_Id":"5","Child_Name":"Next Day 12:00 pm"},{"Child_Id":"5","Child_Name":"World Priority Exp"},{"Child_Id":"6","Child_Name":"FedEx 1Day Freight"},{"Child_Id":"6","Child_Name":"FedEx 2Day"},{"Child_Id":"6","Child_Name":"FedEx 2Day Freight"},{"Child_Id":"6","Child_Name":"FedEx 2Day® A.M."},{"Child_Id":"6","Child_Name":"FedEx 3Day Freight"},{"Child_Id":"6","Child_Name":"FedEx Express Saver"},{"Child_Id":"6","Child_Name":"FedEx First Overnight"},{"Child_Id":"6","Child_Name":"FedEx International Economy"},{"Child_Id":"6","Child_Name":"FedEx International Economy Freight"},{"Child_Id":"6","Child_Name":"FedEx International First"},{"Child_Id":"6","Child_Name":"FedEx International Priority"},{"Child_Id":"6","Child_Name":"FedEx International Priority Freight"},{"Child_Id":"6","Child_Name":"FedEx Priority Overnight"},{"Child_Id":"6","Child_Name":"FedEx Standard Overnight"},{"Child_Id":"7","Child_Name":"FedEx Ground"},{"Child_Id":"7","Child_Name":"FedEx Home Delivery"},{"Child_Id":"8","Child_Name":"FedEx SmartPost Standard A"},{"Child_Id":"8","Child_Name":"FedEx SmartPost Standard B- Bound Printed Matter"},{"Child_Id":"8","Child_Name":"FedEx SmartPost Standard B- Media Mail"},{"Child_Id":"8","Child_Name":"FedEx SmartPost Standard B- Parcel Post"},{"Child_Id":"12","Child_Name":"Collect Ground"},{"Child_Id":"12","Child_Name":"Ground"},{"Child_Id":"12","Child_Name":"Next Day Air"},{"Child_Id":"12","Child_Name":"Next Day Air Early AM"},{"Child_Id":"12","Child_Name":"Next Day Air Saver"},{"Child_Id":"12","Child_Name":"Second Day Air"},{"Child_Id":"12","Child_Name":"Second Day Air AM"},{"Child_Id":"12","Child_Name":"Standard Canada"},{"Child_Id":"12","Child_Name":"Three Day Select"},{"Child_Id":"12","Child_Name":"World Expedited"},{"Child_Id":"12","Child_Name":"World Expedited Plus"},{"Child_Id":"12","Child_Name":"World Express"},{"Child_Id":"13","Child_Name":"Express Mail-Addressee"},{"Child_Id":"13","Child_Name":"Express Mail-Custom"},{"Child_Id":"13","Child_Name":"Express Mail-Post Office"},{"Child_Id":"13","Child_Name":"FedEx Priority Overnight"},{"Child_Id":"13","Child_Name":"Intl Airmail Letter-Post"},{"Child_Id":"13","Child_Name":"Intl Airmail Parcel Post"},{"Child_Id":"13","Child_Name":"Intl Economy Letter-Post"},{"Child_Id":"13","Child_Name":"Intl Economy Parcel Post"},{"Child_Id":"13","Child_Name":"Intl Global Express Mail"},{"Child_Id":"13","Child_Name":"Intl Priority Mail"},{"Child_Id":"13","Child_Name":"Library"},{"Child_Id":"13","Child_Name":"Library Mail 5 Digit"},{"Child_Id":"13","Child_Name":"Library Mail BMC"},{"Child_Id":"13","Child_Name":"Media Mail BMC"},{"Child_Id":"13","Child_Name":"Media Mail Single Piece"},{"Child_Id":"13","Child_Name":"Standard Mail BMC"}] });});
Your suggestion resolved the issue. Thanks!
Hi Ryan Rupp,
Please let me know if you have any further questions?
Thanks,
Todor Paskalev
Infragistics
The issue here seems to be the following - , parentCombo: '#CARRIER', parentComboKey: 'Parent_Name',
you have parentComboKey set in the child combo but you need to have a key in the child datasource in that case called 'Parent_Name' , which contains value corresponding to a record from the parent. To summarize in your last output - the "#" sign should stay, and the child dataSource should have the following structure:
dataSource: [{
"Child_Id": "1",
"Child_Name": "Collect Ground",
"Parent_Name": "UPS" //add this
},
So once you have selected the value from the parent combo the values in the second get filtered by the parent selected key, but there should be relation into the child datasource, so the second combo can filter the items.
Hope that will help you achieve your goal.
Infragitics
I added the # and I got the same result. Here is the new output:
function() {$('#CARRIER').igCombo({ filterExprUrlKey: 'filter', valueKey: 'Parent_Id', textKey: 'Parent_Name', filteringType: 'local', renderMatchItems: 'startswith', filteringCondition: 'startsWith', autoComplete: true, disabled: false, selectedItems: null, validatorOptions: { onblur: true, onchange: false, onsubmit: true, formSubmit: true, keepFocus: 'never', showIcon: true, required: true }, dropDownWidth: 175, width: '175', inputName: 'CARRIER', loadOnDemandSettings: null, dataSource: [{"Parent_Id":"1","Parent_Name":"UPS"}] });});
function() {$('#childCARRIER').igCombo({ filterExprUrlKey: 'filter', valueKey: 'Child_Id', textKey: 'Child_Name', filteringType: 'local', renderMatchItems: 'startswith', filteringCondition: 'startsWith', autoComplete: true, disabled: false, selectedItems: null, validatorOptions: { onblur: true, onchange: false, onsubmit: true, formSubmit: true, keepFocus: 'never', showIcon: true, required: true }, dropDownWidth: 175, width: '175', parentCombo: '#CARRIER', parentComboKey: 'Parent_Name', inputName: 'childCARRIER', loadOnDemandSettings: null, dataSource: [{"Child_Id":"1","Child_Name":"Collect Ground"},{"Child_Id":"1","Child_Name":"Ground"},{"Child_Id":"1","Child_Name":"Next Day Air"},{"Child_Id":"1","Child_Name":"Next Day Air Early AM"},{"Child_Id":"1","Child_Name":"Next Day Air Saver"},{"Child_Id":"1","Child_Name":"Second Day Air"},{"Child_Id":"1","Child_Name":"Second Day Air AM"},{"Child_Id":"1","Child_Name":"Standard Canada"},{"Child_Id":"1","Child_Name":"Three Day Select"},{"Child_Id":"1","Child_Name":"World Expedited"},{"Child_Id":"1","Child_Name":"World Expedited Plus"},{"Child_Id":"1","Child_Name":"World Express"}] });});
When you set the child combo - the ParentComboID should be prefixed with "#" sign. Can you test your case with that change, if that doesn't help I'll investigate the situation with more details.