• EXT.NET GridPanel(按键事件带参的另一种写法)


    <%@ Page Language="C#" %>
      
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
      
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                
                    new object[] { "id1", "test1" },
                    new object[] { "id2", "test2" },
                    new object[] { "id3", "test3" }
                };
                store.DataBind();
            }
        }
      
        protected void Command(object sender, DirectEventArgs e)
        {
            X.Msg.Alert("Command", e.ExtraParams["id"] + " : " + e.ExtraParams["command"]).Show();
        }
    </script>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
            <Store>
                <ext:Store runat="server">
                    <Reader>
                        <ext:ArrayReader>
                            <Fields>
                                <ext:RecordField Name="id" />
                                <ext:RecordField Name="test" />
                            </Fields>
                        </ext:ArrayReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column Header="Test" DataIndex="test" />
                    <ext:CommandColumn Width="60">
                        <Commands>
                            <ext:GridCommand Icon="Delete" CommandName="Delete" />
                            <ext:GridCommand Icon="NoteEdit" CommandName="Edit" />
                        </Commands>
                    </ext:CommandColumn>
                </Columns>
            </ColumnModel>
            <DirectEvents>
                <Command OnEvent="Command">
                    <ExtraParams>
                        <ext:Parameter Name="id" Value="record.data.id" Mode="Raw" />
                        <ext:Parameter Name="command" Value="command" Mode="Raw" />    //get the GridCommand name
                    </ExtraParams>
                </Command>
            </DirectEvents>
        </ext:GridPanel>
        </form>
    </body>
    </html>
  • 相关阅读:
    eclipse不能反编译 eclipse中Source not found解决方法
    3. copy 使用及示例
    pgbench 使用介绍及示例
    1. 将 TDSQL 接入已经在使用的 HDFS
    1.PGbadger 慢日志分析工具
    1. pg_dump 使用及示例
    5.6.10 HDFS DN 节点扩容
    关于 PG CVE202221724 漏洞处理
    2.pg_dumpall 使用及示例
    4.pg_bulkload 数据加载使用及示例
  • 原文地址:https://www.cnblogs.com/wujy/p/2181787.html
Copyright © 2020-2023  润新知