本帖最后由 yygy 于 2018-4-5 14:49 编辑
参考:http://fineui.com/bbs/forum.php? ... =%E4%B8%8B%E6%8B%89
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="FineUIPro.EmptyProjectNet40.WebForm1" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div id="mask" class="mask" style="display: none;"></div>
- <f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="RegionPanel1"></f:PageManager>
- <f:DropDownList runat="server" ID="DropDownList1" EnableEdit="true" AutoSelectFirstItem="false" EmptyText="输入A或B">
- </f:DropDownList>
- <f:Grid ID="Grid1" ShowBorder="true" Title="表格" Width="800px" runat="server" EnableCollapse="true"
- OnRowClick="Grid1_RowClick" EnableRowClickEvent="true" DataKeyNames="Id" ShowHeader="false">
- <Columns>
- <f:RowNumberField />
- <f:BoundField Width="100px" DataField="name" DataFormatString="{0}" HeaderText="姓名" />
- </Columns>
- </f:Grid>
- </form>
- </body>
- <script src="DDLGrid.js"></script>
- <script type="text/javascript">
- F.ready(function () {
- if (F.ui.DropDownList1.initGrid) {
- F.ui.DropDownList1.initGrid('Grid1');
- }
- //点击表格内容
- $('#Grid1').find("div[class='f-grid-table f-grid-row-lines']").bind("click", (function () {
- alert("ok");//单击无效????????????????
- }));
- })
- </script>
- </html>
- if (F.DropDownList) {
- $.extend(F.DropDownList.prototype, {
- //下拉树
- initGrid: function (Gridid) {
- var t = this;
- var dllGrid = F.ui[Gridid];
- //记录哪写控件用到了Grid为收缩 准备
- if (!dllGrid.ddlids) {
- dllGrid.ddlids = [];
- }
- dllGrid.ddlids.push(t.id);
- //记录该控件的Grid
- t.dllGrid = dllGrid;
- dllGrid.hide();
- if (!t.listeners) {
- t.listeners = {};
- }
- t.on("trigger2click", function (e, k) {
- __doPostBack('TextBox1_ENTER', F.ui.DropDownList1.getText());
- dllGrid.ddlid = t.id;
- dllGrid.hide();
- dllGrid.setWidth($("#" + t.id).width());
- $(dllGrid.renderTo).css('top', $("#" + t.id).offset().top + $("#" + t.id).height());
- $(dllGrid.renderTo).css('left', $("#" + t.id).offset().left);
- $(dllGrid.renderTo).css('position', 'fixed');
- $(dllGrid.renderTo).css('z-index', '9999');
- $(dllGrid.renderTo).css('overflow', 'auto');
- $(dllGrid.renderTo).css('max-height', ($('body').height() - 100) + 'px');
- dllGrid.show();
- });
- t.on("blur", function (e) {
- //增加隐藏Grid事件
- if (!dllGrid.isBox) {
- dllGrid.hide();
- }
- });
- dllGrid.find("table[class='f-grid-table f-grid-row-lines']").on("click", function () {
- alert("ok");//单击无效????????????????
- });
- }
- })
- };
复制代码
|