问题描述
我正在使用Telerik RadComboBox控件.我有两个相关的组合,当用户在第一个中选择一个值时,我将过滤第二个.
I'm using the Telerik RadComboBox control. I have two related combos and when the user selects a value in the first one I filter the second one.
我使用以下代码实现这一目标:
I use the code below to achieve this:
localeCombo = $find("<%= ddlLocale.ClientID %>");
localeCombo.requestItems(item.get_value(), false);
这完全可以正常工作,但是当我回发时,尽管所有其他控件都保持其状态,但已过滤的组合会重置为原始未过滤的列表.我认为这是因为使用客户端回调requestItems()函数时不会更新服务器端项目列表.
This works totally fine, but when I do a postback my filtered combo resets to the original non filtered list, although all other controls retain their state. I assume this is because the server side list of items is not being updated when I use the client side callback requestItems() function.
是这种情况吗?有没有解决这个问题的简单方法?
Is this the case? Is there a simple way around this?
任何帮助将不胜感激!
谢谢
克里斯
推荐答案
是的,很可能您的建议是正确的.您可以尝试将第二个过滤后的组合值保留在会话或缓存存储中,然后在回发时从那里恢复它-至少这是我要做的.
Yep, most probably your suggestion is true. You may try keeping the second filtered combo value in session or cache storage and then restore it from there on postback - at least this is what I would do.
这篇关于使用客户端requestItems()加载时,Telerik RadCombobox无法保持状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!