Ext.Net弹出子窗口

1、前台代码:

<ext:ImageCommandColumn Width="60" Header="操作" Align="Center">
                                            <Commands >
                                                <ext:ImageCommand CommandName="Edit" Icon="TableEdit" Text="操作">
                                                    <ToolTip Text="操作" />
                                                </ext:ImageCommand>
                                            </Commands>
  </ext:ImageCommandColumn>

<Listeners>
                       
                                    <%--<Command Handler="Ext.Msg.alert(command, record.data.mc_MaterialCode);" />--%>
                                    <%--<Command Handler="CompanyX.showPage(record.data.Id);"/>--%>
                                    <Command Handler="showWindow(record.data.Id);"/>
                                   
                                 <%--  #{Window1}.show(this);--%>

</Listeners>

 

2、弹出子页面方法

第一种:

 

[Ext.Net.DirectMethod]
        public void showPage(string ss)
        {
            var win = new Ext.Net.Window
            {
                ID = "Window1",
                Title = "使用记录",
                Width = Unit.Pixel(1000),
                Height = Unit.Pixel(600),
                Modal = true,
                Collapsible = true,
                Maximizable = true,
                Hidden = true
            };


            win.AutoLoad.Url = "~/StorageRecord/UsedDetail.aspx?ID=" + ss;
            win.AutoLoad.Mode = Ext.Net.LoadMode.IFrame;
            win.Render(this.Form);

            win.Show();
        }

第二种:

<script type="text/javascript">
        function showWindow(maCode) {
            var iTop = (window.screen.availHeight - 30 - 400) / 2;
            //获得窗口的水平位置
            var iLeft = (window.screen.availWidth - 10 - 800) / 2;
            //window.showModalDialog("UsedDetail.aspx?ID=" + maCode, "使用明细", "dialogHeight=400px,dialogWidth=800,center=yes,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no");
            window.open("UsedDetail.aspx?ID=" + maCode, "使用明细", "dialogHeight=400px,dialogWidth=800,left=" + iLeft + ",top=" + iTop + ",center=yes,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no");
            }
        </script>

posted @ 2013-05-10 22:48  王春天  阅读(840)  评论(2编辑  收藏  举报
云推荐