Jquery 插件汇总

$(usersManageDatagrid).datagrid({
        iconCls:'icon-save',
        width:600,
        height:350,
        nowrap: false, // 是否一行显示
        striped: true, // 是否显示斑马线
        fit: true,
        url:'../../json/user_data_1.json',
        sortName: 'userId',
        sortOrder: 'desc',
        idField:'userId',
        frozenColumns:[[
            {field:'ck',checkbox:true},
            {field:'userId',title:'用户编号',width:60,sortable:true},
            {field:'userName',title:'用户名',width:120,sortable:true}
        ]],
        columns:[[
            {field:'name',title:'姓名',width:80,sortable:true},
            {field:'sex',title:'性别',width:40,sortable:true,
                formatter:function(value,rec){
                    if(value == '0'){
                        return '保密';
                    } else if(value == '1'){
                        return '男';
                    } else if(value == '2'){
                        return '女';
                    } else {
                        return '不详';
                    }
                }
            },
            {field:'birthday',title:'出生日期',width:80},
            {field:'age',title:'年龄',width:40},
            {field:'createDate',title:'注册日期',width:130},
            {field:'remark',title:'备注',width:200}
        ]],
        pagination:true, // 是否显示分页
        rownumbers:true, // 是否显示行号
        toolbar:['-',{   
            id:'newBtn',   
            text:'新增',   
            iconCls:'icon-add',   
            handler:function(){   
                $('#users_manage_edit_panel').window({
                    title: '新增信息',
                    modal: true,
                    shadow: false,
                    closed: false
                });
            }   
        },'-',{
            id:'editBtn',
            text:'编辑',
            iconCls:'icon-edit',
            handler:function(){
                var selected = $(usersManageDatagrid).datagrid('getSelected');
                $('#users_manage_edit_panel').window({
                    title: '编辑信息',
                    modal: true,
                    shadow: false,
                    closed: false
                });
            }
        },'-',{   
            id:'deleteBtn',   
            text:'删除',
            iconCls:'icon-cancel',
            handler:function(){
                var ids = new Array();
                // 选中行记录
                var rows = $(usersManageDatagrid).datagrid('getSelections');
                if(rows.length<1){   
                    $.messager.alert('信息窗口','请选择要删除的数据!','info');
                    return;
                }
                // 遍历获取编码
                for(var i=0;i<rows.length;i++){
                    ids.push(rows[i].userId);
                }
                $.messager.alert('信息窗口', ids,'info');
            }
        },'-',{
            id:'queryBtn',
            text:'查询',
            iconCls:'icon-search',
            handler:function(){
                // 查询参数对象
                var queryParams = $(usersManageDatagrid).datagrid('options').queryParams;
                
                // 设置参数对象属性
                queryParams.queryWord = '1';
                queryParams.queryType = '2';

                // 加载查询
                $(usersManageDatagrid).datagrid('reload');
            }
        },'-'
        ]  
    });

你可能感兴趣的:(jquery,json)