js-grid简单使用

来源:互联网 发布:天津网络报警平台 编辑:程序博客网 时间:2024/05/21 14:57
$("#jsGrid").jsGrid({width:"100%",//宽度height:"400px",//高度inserting:true,//是否可以插入新数据editing: true,//是否可以编辑        sorting: true,//是否可以排序        paging: true,//是否通过页面加载数据        invalidNotify:$.noop, //当无效输入时什么都不做        autoload: true,//是否自动加载fields:[ //表头//name:表格字段的名称   type:表格字段的属性         //width:表格字段的宽度   vaildate:数据验证规则        //items:select的数据集        //valueField:作为select的数据值        //textField:作为select的表示        //type:"text"|"number"|"checkbox"|"select"|"textarea"|"control"等操作类型{name:"id",type:"number", width: 20},{name:"bookName",type:"text", width: 50},{name:"bookAuthor",type:"text", width: 50},{name:"category",type:"text", width: 30},{name:"detail",type:"text", width: 150},{name:"publication",type:"text", width: 50},{name:"publicationYear",type:"text", width: 50},{type:"control"}],controller: {//空间控制方法,增删改查/*controller: {        loadData: $.noop,        insertItem: $.noop,        updateItem: $.noop,        deleteItem: $.noop    },*/        loadData: function(){        return $.ajax({        url:"./books",        type:"GET"        })        }    }});