在命令事件上显示 ExtNet.Msg.Alert?

发布于 2024-12-11 21:12:20 字数 3037 浏览 0 评论 0原文

下面是我的代码:

<ext:GridPanel ID="gpMaster" runat="server" Title="List Of Messages" StripeRows="true"
    AutoWidth="true" TrackMouseOver="true" Height="330" StoreID="stoMaster">
    <ColumnModel ID="ColumnModel1" runat="server">
        <Columns>
            <ext:Column ColumnID="ID" Header="ID" Width="50" DataIndex="ID" Resizable="false"
                MenuDisabled="true" Fixed="true" Align="Right" />
            <ext:Column ColumnID="Subject" Header="Subject" DataIndex="Subject" Align="Right"
                Width="300">
            </ext:Column>
            <ext:Column Header="Sender" DataIndex="Sender" Width="100" Align="Right">
            </ext:Column>
            <ext:Column Header="Receive Date" DataIndex="ReceiveDate" Align="Right" Width="100">
            </ext:Column>
            <ext:ImageCommandColumn Width="60" Align="Right" Css="text-align:center;">
                <Commands>
                    <ext:ImageCommand CommandName="Edit" Icon="TableEdit" Text="Edit">
                    </ext:ImageCommand>
                </Commands>
            </ext:ImageCommandColumn>
            <ext:ImageCommandColumn Width="60" Align="Center">
                <Commands>
                    <ext:ImageCommand CommandName="Delete" Icon="Delete" Text="Delete">
                    </ext:ImageCommand>
                </Commands>
            </ext:ImageCommandColumn>
        </Columns>
    </ColumnModel>
    <DirectEvents>
        <Command OnEvent="Command">
            <EventMask ShowMask="true"></EventMask>
            <ExtraParams>
                <ext:Parameter Name="id" Value="record.data.ID" Mode="Raw" />
                <ext:Parameter Name="command" Value="command" Mode="Raw" />
            </ExtraParams>
        </Command>
    </DirectEvents>
    <SelectionModel>
        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
    </SelectionModel>
    <BottomBar>
        <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="stoMaster"
            EmptyMsg="&nbsp;" DisplayMsg="&nbsp;" BeforePageText="Page" Cls="LTR" />
    </BottomBar>
</ext:GridPanel>


protected void Command(object sender, DirectEventArgs e)
{
    int messageID = int.Parse(e.ExtraParams["id"]);
    string commandName = e.ExtraParams["command"];

    switch (commandName)
    {
        case "Edit":
            ShowEditElements(messageID);
            break;
        case "Delete":
            DeleteMessage(messageID);
            break;
    }
}

void ShowEditElements(int messageID)
{
    ExtNet.Msg.Alert("edit", "ShowEditElements");//Problem
}

void DeleteMessage(int messageID)
{
    ExtNet.Msg.Alert("del", "DeleteMessage");//Problem
}

一切正常,但 ExtNet.Msg.Alerts 没有显示! 有什么问题吗? 我该如何解决它?

Below is my code :

<ext:GridPanel ID="gpMaster" runat="server" Title="List Of Messages" StripeRows="true"
    AutoWidth="true" TrackMouseOver="true" Height="330" StoreID="stoMaster">
    <ColumnModel ID="ColumnModel1" runat="server">
        <Columns>
            <ext:Column ColumnID="ID" Header="ID" Width="50" DataIndex="ID" Resizable="false"
                MenuDisabled="true" Fixed="true" Align="Right" />
            <ext:Column ColumnID="Subject" Header="Subject" DataIndex="Subject" Align="Right"
                Width="300">
            </ext:Column>
            <ext:Column Header="Sender" DataIndex="Sender" Width="100" Align="Right">
            </ext:Column>
            <ext:Column Header="Receive Date" DataIndex="ReceiveDate" Align="Right" Width="100">
            </ext:Column>
            <ext:ImageCommandColumn Width="60" Align="Right" Css="text-align:center;">
                <Commands>
                    <ext:ImageCommand CommandName="Edit" Icon="TableEdit" Text="Edit">
                    </ext:ImageCommand>
                </Commands>
            </ext:ImageCommandColumn>
            <ext:ImageCommandColumn Width="60" Align="Center">
                <Commands>
                    <ext:ImageCommand CommandName="Delete" Icon="Delete" Text="Delete">
                    </ext:ImageCommand>
                </Commands>
            </ext:ImageCommandColumn>
        </Columns>
    </ColumnModel>
    <DirectEvents>
        <Command OnEvent="Command">
            <EventMask ShowMask="true"></EventMask>
            <ExtraParams>
                <ext:Parameter Name="id" Value="record.data.ID" Mode="Raw" />
                <ext:Parameter Name="command" Value="command" Mode="Raw" />
            </ExtraParams>
        </Command>
    </DirectEvents>
    <SelectionModel>
        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
    </SelectionModel>
    <BottomBar>
        <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="stoMaster"
            EmptyMsg=" " DisplayMsg=" " BeforePageText="Page" Cls="LTR" />
    </BottomBar>
</ext:GridPanel>


protected void Command(object sender, DirectEventArgs e)
{
    int messageID = int.Parse(e.ExtraParams["id"]);
    string commandName = e.ExtraParams["command"];

    switch (commandName)
    {
        case "Edit":
            ShowEditElements(messageID);
            break;
        case "Delete":
            DeleteMessage(messageID);
            break;
    }
}

void ShowEditElements(int messageID)
{
    ExtNet.Msg.Alert("edit", "ShowEditElements");//Problem
}

void DeleteMessage(int messageID)
{
    ExtNet.Msg.Alert("del", "DeleteMessage");//Problem
}

Everything is OK , But ExtNet.Msg.Alerts didn't shown !!!
What's wrong with it ?
how can I fix it ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

琉璃繁缕 2024-12-18 21:12:20

我在编写代码时遇到问题。
我只好改成

ExtNet.Msg.Alert("edit", "ShowEditElements");

问题

ExtNet.Msg.Alert("edit", "ShowEditElements").Show(); 

解决了。

I had a problem in writing the code.
I had to change

ExtNet.Msg.Alert("edit", "ShowEditElements");

to

ExtNet.Msg.Alert("edit", "ShowEditElements").Show(); 

The problem was solved.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文