0

jQueryを使用して、「dialog-tatto」というdivのコンテンツを含むダイアログを作成しています。しかし、何らかの理由でそれは機能しません。これは私の現在のコードです:

    var button = $(".ui-dialog-buttonpane button:contains(\"New\")"); 
    $(button).show();
    button = $(".ui-dialog-buttonpane button:contains(\"Update\")");
    $(button).hide();
    $("#dialog-tattoo").dialog("open");

これは私のdivです:

            <div id="dialog-tattoo">
            <table>
                <tr>
                    <td>
                        <asp:Label ID="lblPersonMarkType" runat="server" Text="Mark type:" meta:resourcekey="lblPersonMarkTypeResource1" />
                        <asp:DropDownList ID="ddlPersonMarkType" Width="120px" runat="server" AppendDataBoundItems="True"
                            DataSourceID="dsPersonMarkType" DataTextField="ScarTattooName" DataValueField="ScarTattooTypeID"
                            OnPreRender="ddl_PreRender" meta:resourcekey="ddlPersonMarkTypeResource1">
                            <asp:ListItem Value="-1" meta:resourcekey="ListItemResource1">--Select--</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="lblPersonBodyLocation" runat="server" Text="Body Location:" meta:resourcekey="lblPersonBodyLocationResource1" />
                        <asp:DropDownList ID="ddlPersonBodyLocation" Width="120px" runat="server" AppendDataBoundItems="True"
                            DataSourceID="dsPersonBodyLocation" DataTextField="BodyLocation" DataValueField="BodyLocationID"
                            OnPreRender="ddl_PreRender" meta:resourcekey="ddlPersonBodyLocationResource1">
                            <asp:ListItem Value="-1" meta:resourcekey="ListItemResource1">--Select--</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td colspan='2'>
                        <asp:Label ID="lblPersonMarkDescription" runat="server" Text="Description:" meta:resourcekey="lblPersonMarkDescriptionResource1" />
                        <asp:TextBox ID="txtPersonMarkDescription" runat="server" Height="40px" TextMode="MultiLine"
                            Width="400px" meta:resourcekey="txtPersonMarkDescriptionResource1" />
                    </td>
                </tr>
            </table>
        </div>
4

1 に答える 1

2

これを使って

$("#dialog-tattoo").dialog();

それ以外の

$("#dialog-tattoo").dialog("open");

デモ

更新:(タイトル付き)

$("#dialog-tattoo").dialog({
    title:'This is my Title'
});

デモ

更新:(動的ボタンの場合)

$("<div/>",{
    'text':'Button',
    'id':'btn1',
    'class':'myBtn',
    'style':'margin:5px;color:green;'
}).button().appendTo('body');

デモ

于 2012-11-16T20:25:41.213 に答える