easyuiのdatagridのjsロード

3912 ワード

        //   DataGird       
        function InitGrid(queryData) {
            $('#grid').datagrid({   //   Table  ,Table   ID grid
                url: '/Menu/FindWithPager',   //     Action           Json     
                title: '    ',
                iconCls: 'icon-view',
                height: 650,
                width: function () { return document.body.clientWidth * 0.9 },
                nowrap: true,
                autoRowHeight: false,
                striped: true,
                collapsible: true,
                pagination: true,
                pageSize: 100,
                pageList: [50,100,200],
                rownumbers: true,
                //sortName: 'ID',    //       easyUI  
                sortOrder: 'asc',
                remoteSort: false,
                idField: 'ID',
                queryParams: queryData,  //       
                columns: [[
                    { field: 'ck', checkbox: true },   //  
                     { title: '    ', field: 'Name', width: 200},
                     { title: '  ', field: 'Icon', width: 150 },
                     { title: '  ', field: 'Seq', width: 80 },
                     { title: '  ID', field: 'FunctionId', width: 80 },
                     { title: '    ', field: 'Visible', width: 80 },
                     { title: 'Winform    ', field: 'WinformType', width: 400 },
                     { title: 'Web  Url  ', field: 'Url', width: 200 },
                     { title: 'Web       ', field: 'WebIcon', width: 120 },
                     { title: '    ', field: 'SystemType_ID', width: 80 }
                ]],
                toolbar: [{
                    id: 'btnAdd',
                    text: '  ',
                    iconCls: 'icon-add',
                    handler: function () {
                        ShowAddDialog();//         
                    }
                }, '-', {
                    id: 'btnEdit',
                    text: '  ',
                    iconCls: 'icon-edit',
                    handler: function () {
                        ShowEditOrViewDialog();//         
                    }
                }, '-', {
                    id: 'btnDelete',
                    text: '  ',
                    iconCls: 'icon-remove',
                    handler: function () {
                        Delete();//           
                    }
                }, '-', {
                    id: 'btnView',
                    text: '  ',
                    iconCls: 'icon-table',
                    handler: function () {
                        ShowEditOrViewDialog("view");//             
                    }
                }, '-', {
                    id: 'btnReload',
                    text: '  ',
                    iconCls: 'icon-reload',
                    handler: function () {
                        //          
                        $("#grid").datagrid("reload");
                    }
                }],
                onDblClickRow: function (rowIndex, rowData) {
                    $('#grid').datagrid('uncheckAll');
                    $('#grid').datagrid('checkRow', rowIndex);
                    ShowEditOrViewDialog();
                }
            })
        };

単一選択と行選択の問題:
//    
singleSelect: false,
//               
checkOnSelect: false, 
selectOnCheck: false,
//      ,        
onSelect: function (rowData) {
                navgrid.datagrid("unselectAll");
 }