<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ModuleScript.aspx.cs" Inherits="System_ModuleScript_ModuleScript" %>
<%@ Register Src="~/Scripts/AWGridRuntime/UserControl/ListHeader.ascx" TagPrefix="uc1" TagName="ListHeader" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <uc1:ListHeader runat="server" ID="ListHeader" />
    <script type="text/javascript">
        //搜索
        function search_grid() {
            var fg = document.getElementById("frame_grid");
            var keyword = $("#keyword").val();
            var url = "ModuleScript_Grid.aspx?keyword=" + escape(keyword) ;
            fg.src = url;
        }
        //选择打印模板
        function grf_print(){
            var fg = document.getElementById("frame_grid"); //得到grid控件所在iframe
            var cw = fg.contentWindow;
            choice_print_template('<%=xview["auth_code"]%>',"",cw.sql_print_detail_session_id);
        }
        //修改
        function modify() {
            var fg = document.getElementById("frame_grid"); //得到grid控件所在iframe
            var cw = fg.contentWindow;
            var ms_id = cw.aw_GetSelectRows(cw._ms_id); //返回一维数组
            if (ms_id.length == 0) {
                AlertNO('请选择要查看的记录!');
                return;
            }
            if (ms_id.length > 1) {
                AlertNO('一次只可以查看一条记录!');
                return;
            }
            if (ms_id == "")
                return;
            asyncbox.open({
                id: 'win_modify',
                url: 'ModuleScript_Edit.aspx?action=Update&ms_id=' + ms_id,
                modal: true,
                title: '修改'
            });
        }
    </script>
</head>
<body>
    <!--工具栏-->
    <div style="height:30px;" class="list_menu_bar">
        <input type="text" class="keyword_box" id="keyword"/>
        <a plain="true" class="easyui-linkbutton" onclick="search_grid()">搜索</a>
        <a plain="true" class="easyui-linkbutton" onclick="DesignModuleFormat('System_ModuleScript')">格式</a>
    </div>
    <!--Grid控件所在的iframe-->
    <%=xview["grid_frame"]%>
    <script type="text/javascript">
        $(document).ready(function(){
            search_grid();
            $F("keyword").focus();
            $F("keyword").onkeypress = function (evt) {
                evt = evt ? evt : (window.event ? window.event : null);
                if (evt.keyCode == "13") {
                    search_grid();
                }
            }
        });
    </script>
</body>
</html>
