[英]webforms : use infragistics webdropdown in updatepanel
[英]Multiple Selection on WebDropDown and Reflect It in Another WebDropDown - Infragistics
我有一個名為Specialty的webdropdown和另一個webdropdown名為SubSpeciality。
當我點擊一個專業項目時,子專業列表會被填充。
我使用AutoPostBackFlags-SelectionChanged =“On”和OnSelectionChanged =“wddSpeciality_Selected”來實現這一點。
我的問題是:我需要在Specialty中進行多次選擇,而不需要自動回復頁面,一旦進行了多次選擇,SubSpeciality應該由所有項目一起填充。
因此,如果我刪除AutoPostBackFlag,則列表不會被填充。
請盡快建議我。
我可以使用任何Java Script或Ajax Script來實現這一目標嗎?
如果是,請給我簡要說明。
我的建議是使用更新面板。 選擇項目時禁用第一個WDD的關閉(此設置的屬性為true“EnableClosingDropDownOnSelect”),當第一個菜單關閉以處理此事件(DropDownClosed)並更新包含第二個WDD的更新面板時原因。 另一種選擇是在此事件中執行_postback並避免使用Update Panel。
你在尋找像這樣的解決方案嗎?
function WebDropDown1_SelectionChanged(sender, eventArgs){
var items1 = eventArgs.getNewSelection();
var count = items1.length;
var items2 = $find("WebDropDown2").get_items();
for(var i = 0; i < count; i++)
{
items2._control.selectItemByIndex(items1[i].get_index(), false, true);
}
}
<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px"
EnableMultipleSelection="true"
EnableClosingDropDownOnSelect="false">
<Items>
<ig:DropDownItem Selected="False" Text="item 1" Value="">
</ig:DropDownItem>
<ig:DropDownItem Selected="False" Text="item2" Value="">
</ig:DropDownItem>
<ig:DropDownItem Selected="False" Text="item3" Value="">
</ig:DropDownItem>
</Items>
<ClientEvents SelectionChanged="WebDropDown1_SelectionChanged" />
</ig:WebDropDown>
<ig:WebDropDown ID="WebDropDown2" runat="server" Width="200px"
EnableMultipleSelection="true"
EnableClosingDropDownOnSelect="false">
<Items>
<ig:DropDownItem Selected="False" Text="item 1" Value="">
</ig:DropDownItem>
<ig:DropDownItem Selected="False" Text="item2" Value="">
</ig:DropDownItem>
<ig:DropDownItem Selected="False" Text="item3" Value="">
</ig:DropDownItem>
</Items>
</ig:WebDropDown>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.