zoukankan      html  css  js  c++  java
  • Ext.Net点击GridPanel中一行,在FormPanel里后台加载详细数据

    参考官方Demo:GridPanel -> Data With Details - Form Details

    其主要过程

    1.在GridPanel的SelectionModel段内编写DirectEvents,DirectEvents的子元素RowSelect的OnEvent属性,这里指定了后台调用的方法名称

    <SelectionModel>
    <ext:RowSelectionModel runat="server" SingleSelect="true">
    <DirectEvents>
    <RowSelect OnEvent="RowSelect" Buffer="100">
    <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{FormPanel1}" />
    <ExtraParams>
    <%-- or can use params[2].id as value --%>
    <ext:Parameter Name="EmployeeID" Value="this.getSelected().id" Mode="Raw" />
    </ExtraParams>
    </RowSelect>
    </DirectEvents>
    </ext:RowSelectionModel>
    </SelectionModel>

    2.编写后台功能代码

    protected void RowSelect(object sender, DirectEventArgs e)
    {
    string employeeID = e.ExtraParams["EmployeeID"];

    Employee empl
    = Employee.GetEmployee(int.Parse(employeeID));

    this.FormPanel1.SetValues(new {
    empl.EmployeeID,
    empl.FirstName,
    empl.LastName,
    empl.Title,
    ReportsTo
    = empl.ReportsTo.HasValue ? (Employee.GetEmployee(empl.ReportsTo.Value).LastName) : "",
    empl.HireDate,
    empl.Extension,
    empl.Address,
    empl.City,
    empl.PostalCode,
    empl.HomePhone,
    empl.TitleOfCourtesy,
    empl.BirthDate,
    empl.Region,
    empl.Country,
    empl.Notes
    });
    }
  • 相关阅读:
    python之json&pickle
    python之装饰器
    软件测试基础
    软件测试分类
    python3文件的读写操作
    python3对excel文件读写操作
    Java集合整理
    mybatis一对多关系的关联查询
    用xftp从win7系统传输一些必要的文件到Linux
    Spring和Mybatis的整合
  • 原文地址:https://www.cnblogs.com/anduinlothar/p/2101521.html
Copyright © 2011-2022 走看看