开发者

how to disable a ajaxtoolkit CollapsiblePanelExtender from client side?

does anyone know a client side method to disable the Collapsi开发者_运维问答blePanelExtender?

I have get the extender by behaviorId.

var extender = $find("behaviorId");

so next what method i can use to disable this extender from client side?

Thanks


I'm not sure if this helps... but when runat = "server" you can set the ExpandControlID and the CollapseControlID to "". Then reset it back when finished.

e.g.,

<Ajax:CollapsiblePanelExtender SkinID="CollapsiblePanelExtenderPlusMinus" ID="cpeOne"
    runat="server" TargetControlID="pnlOne" ExpandControlID="pnlHeadingOne"
    CollapseControlID="pnlHeadingOne" Collapsed="false" 
    ImageControlID="imgPlusMinusOne"
    SuppressPostBack="false">
</Ajax:CollapsiblePanelExtender>

<asp:Panel ID="pnlHeadingOne" runat="server">
    <h3>
        <asp:Image runat="server" ID="imgPlusMinusOne" ToolTip="Show/Hide details" />
    Details
    </h3>
</asp:Panel>

Then in code behind - when clicking on an Edit button:

protected void BtnEditClick(object sender, EventArgs e) {
    DisableCollapsiblePanelExtenders();
}

private void DisableCollapsiblePanelExtenders() {
    this.cpeOne.ExpandControlID = "";
    this.cpeOne.CollapseControlID = "";         
}

// Reset the CollapsiblePanelExtender
private void EnableCollapsiblePanelExtenders() {
    this.cpeOne.ExpandControlID = this.pnlHeadingOne.ID;
    this.cpeOne.CollapseControlID = this.pnlHeadingOne.ID;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜