JQGrid 设置请求同步

在使用 JQGrid 表单的时候,默认请求是异步的,不会阻塞后面的方法,但有时候需要在后面方法中对页面数据获取到时候在进行操作。

增加配置:
ajaxGridOptions:{async: false},//使用同步的方式,true为异步方式

/* 生成原始档案任务列表 */
grid = $("#queryData_1").jqGrid({
       url: '${_ctx}/data/statisticTaskList.do',
       ajaxGridOptions:{async: false},//使用同步的方式,true为异步方式
       mtype: 'post',
       datatype: "local",
       height: 410,
       autowidth: true,
       colModel: [
   {name:"taskCode", label:"项目编码", width:200, align:"center",sortable: false},
           {name:"name", label:"项目名称", width:200, align:"center",sortable: false},
           {name:"content", label:"工作内容", width:210, align:"center",sortable: false},
           {name:"creatorTime",label:"创建时间", width: 150, align: "center", sortable: false,formatter:function(cellvalue, options, rowdata){
                   return cellvalue!=null?cellvalue.dateFormat("yyyy-MM-dd"):"";
           }}
       ],
       postData: {
               },
       id:"id",
       pgbuttons:true,
       viewrecords: true,
       pagerpos:"center",
       altRows:true,
       sortname: "id",
       sortorder: "desc",
       jsonReader : {
           root: "datas",   // json中代表实际模型数据的入口
           repeatitems: false // 如果设为false,则jqGrid在解析json时,会根据name来搜索对应的数据元素(即可以json中元素可以不按顺序);而所使用的name是来自于colModel中的name设定。
       },
       prmNames : {
       }
   });

相关文章

转载请注明: 转载自 浮生一程
本文链接地址 JQGrid 设置请求同步
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇