DataGrid Checkbox 数据设定、取值 如何通过post请求向后台提交[]数组

来源:互联网 发布:java官网下载旧版jdk 编辑:程序博客网 时间:2024/05/17 18:24

1.checked 为 true

2.idField=“....”勾选的项的记忆//很多时候和checkbox配合使用时建议不添加 否则 操作完 刷新还会记忆之前的勾选项

3.遍历获得选中项的某个值
var checkedItems = $('#tt').datagrid('getChecked');
    var _list = [];    
    $.each(checkedItems, function(index, item){
        _list.push(item.pqId);
        });


4.如何通过post请求向后台提交[]数组

showConfirm(market.content.title, "确认打开数据?", function(){
          showProcess(true);
         jQuery.ajaxSettings.traditional = true;//少了的话后台娶到Null
         $.post('url',
            {"_list":_list},
            function(data) {
              showProcess(false);
              if (data.return_code == '1') {
                top.showMsg(market.content.title, data.return_msg, alert);
                $("#tt").datagrid('reload');
            } else {
                $.messager.alert(market.content.title, data.return_msg);
            }
          },
        "json");
       });

5.后台取值

@RequestMapping(value = "url", method = RequestMethod.POST)
    public void test(int[] _list ,HttpServletResponse response)






参考:http://blog.csdn.net/baronyang/article/details/9323463

http://www.cnblogs.com/mitang/p/4062984.html

http://www.cnblogs.com/garfieldzhong/p/5124589.html


阅读全文
0 0
原创粉丝点击