当前位置: 代码迷 >> Web前端 >> jqgrid小结
  详细解决方案

jqgrid小结

热度:62   发布时间:2012-08-08 14:32:45.0
jqgrid总结


1.数据一直在loading(格式问题)
??? ??? 此种格式为false
??? ??? {"total":5,"page":1,"records":20,"rows":[{"proRest":31,"id":45,"proName":null},{"proRest":123,"id":41,"proName":"aaa5"},{"proRest":123,"id":39,"proName":"aaaaa3"},{"proRest":1123,"id":38,"proName":"aaaa"}]}
??? ??? 此种格式为true
??? ??? {"page":1,"total":2,"records":2,"rows":[{"id":"SNMZ","cell":["SNMZ","n","金钻卡"]},{"id":"SNMZ","cell":["SNMZ","n","金钻卡"]},{"id":"SNMZ","cell":["SNMZ","n","白金卡"]}]}
??? ??? jsonReader: {
??? ??? ??? ??? repeatitems : false
??? ??? },

2.JqGrid 编辑删除更新的时候不能关闭窗口(一一对应的)
??? jQuery("#list").jqGrid('navGrid', '#pager',{
??? ??? ??? add:true,
??? ??? ??? edit:true,
??? ??? ??? del:true
??? ??? },{
??? ??? ??? closeAfterEdit:true,??? ??? ??? //edit
??? ??? ??? reloadAfterSubmit : true,
??? ??? ??? checkOnSubmit:true
??? ??? },{??? ??? ??? ??? ??? ??? ??? ??? ??? //add
??? ??? ??? closeAfterAdd:true,
??? ??? ??? reloadAfterSubmit : true,
??? ??? },{??? ??? ??? ??? ??? ??? ??? ??? ??? //del
??? ???
??? ??? },{??? ??? ??? ??? ??? ??? ??? ??? ??? //search
??? ??? ??? closeAfterSearch:true,
??? ??? ??? reloadAfterSubmit : true,
??? ??? ??? multipleSearch:true
??? ??? });
??? ???
3.增删改查用的都是同一个url:editurl:'${ctx}/order/product/edit/',? 传递参数_search,oper
??? 只是传递的参数不同
??? 添加修改删除的时候传递的_search的值为false 传递的oper分别 为"add","edit","del"
??? 搜索的时候传递的的_search的值为true