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
    });
    }
  • 相关阅读:
    POJ2299--树状数组求逆序数
    每周总结
    2016湖南省赛--A题--2016
    ACM暑期训练总结
    jQuery实现拖动布局并将排序结果保存到数据库
    TP3.2整合kindeditor
    TP3.2整合uplodify文件上传
    Sublime Text3 使用
    ThinkPHP AJAX分页及JS缓存的应用
    Thinkphp分页类使用
  • 原文地址:https://www.cnblogs.com/anduinlothar/p/2101521.html
Copyright © 2011-2022 走看看