如何从收盘点击prevent

如何从收盘点击prevent

本文介绍了如何从收盘点击prevent Ajax工具包DropDownExtender?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下code来实现与复选框一个DropDownList。我的问题是,每次我点击复选框DropDownList的关闭,我需要重新打开它,选择更多的复选框。我如何使它所以DropDownList的不到风度关闭,直到我点击了呢?

 < ASP:面板ID =pnl_Items=服务器BORDERCOLOR =水族边框宽度=1>
        < ASP:的CheckBoxList ID =cbl_Items=服务器>
            < ASP:ListItem的文本=项目1/>
            < ASP:ListItem的文本=项目2/>
            < ASP:ListItem的文本=项目3/>
        < / ASP:&的CheckBoxList GT;
    < / ASP:面板>   < BR />
    < ASP:文本框ID =tb_Items=服务器>< / ASP:文本框>
    < AJAX:DropDownExtender ID =TextBox1_DropDownExtender
                            =服务器
                            DynamicServicePath =
                            启用=真
                            DropDownControlID =的pnl_Items
                            的TargetControlID =tb_Items>
    < / AJAX:DropDownExtender>


解决方案

我能够通过添加下面的JavaScript,我上的。

  VAR DDE;
 功能页面加载()
 {
     DDE = $找到('<%= TextBox1_DropDownExtender.ClientID%GT;');
     DDE._dropWrapperHoverBehavior_onhover();
     $得到('<%= pnl_Items.ClientID%GT;')。style.width = $ GET('<%= tb_Items.ClientID%GT;')clientWidth。
     如果(DDE._dropDownControl){
         $ common.removeHandlers(DDE._dropDownControl,DDE._dropDownControl $成员);
     }
     DDE._dropDownControl $代表= {
         点击:Function.createDelegate(DDE,SHOWME)
         文本菜单:Function.createDelegate(DDE,DDE._dropDownControl_oncontextmenu)
     }
     $ addHandlers(DDE._dropDownControl,DDE._dropDownControl $成员);
 } 功能SHOWME(){
     DDE._wasClicked = TRUE;
 }

I have the code below to implement a dropdownlist with checkboxes. My problem is that every time i click a checkbox the dropdownlist closes and i need to reopen it to select more checkboxes. How do i make it so the dropdownlist dosn't close until i click off of it?

    <asp:Panel ID="pnl_Items" runat="server" BorderColor="Aqua" BorderWidth="1">
        <asp:CheckBoxList ID="cbl_Items" runat="server">
            <asp:ListItem Text="Item 1" />
            <asp:ListItem Text="Item 2" />
            <asp:ListItem Text="Item 3" />
        </asp:CheckBoxList>
    </asp:Panel>

   <br />
    <asp:TextBox ID="tb_Items" runat="server"></asp:TextBox>
    <ajax:DropDownExtender  ID="TextBox1_DropDownExtender"
                            runat="server"
                            DynamicServicePath=""
                            Enabled="True"
                            DropDownControlID="pnl_Items" on
                            TargetControlID="tb_Items">
    </ajax:DropDownExtender>
解决方案

I was able to get the desired behavior by adding the following javascript that I found on this post.

 var DDE;
 function pageLoad()
 {
     DDE = $find('<%= TextBox1_DropDownExtender.ClientID %>');
     DDE._dropWrapperHoverBehavior_onhover();
     $get('<%= pnl_Items.ClientID %>').style.width = $get('<%= tb_Items.ClientID %>').clientWidth;


     if (DDE._dropDownControl) {
         $common.removeHandlers(DDE._dropDownControl, DDE._dropDownControl$delegates);
     }
     DDE._dropDownControl$delegates = {
         click: Function.createDelegate(DDE, ShowMe),
         contextmenu: Function.createDelegate(DDE, DDE._dropDownControl_oncontextmenu)
     }
     $addHandlers(DDE._dropDownControl, DDE._dropDownControl$delegates);
 }

 function ShowMe() {
     DDE._wasClicked = true;
 }

这篇关于如何从收盘点击prevent Ajax工具包DropDownExtender?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 22:34