专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > JavaScript

JQUERY EASY UI checkbox 回到选中行

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
JQUERY EASY UI checkbox 返回选中行
问题,每次点击按钮获取选中行数,返回结果都是1,以下为代码部分

<script type="text/javascript">

        $(document).ready(function () {

            $('#btnGetSelectRow').click(function () {
                var checkedItems = $("#tt").datagrid("getChecked");
                var names = [];
                window.alert(checkedItems.length);
                $.each(checkedItems, function (index, item) {
                    names.push(item.UID);
                });
                $("#divContent").html(names.join(","));
            });

            $('#tt').datagrid({
                idField: 'id',
                title: '神器大表格',
                iconCls: 'icon-save',
                width: 600,
                height: 300,
                loadMsg: "正在努力加载数据,请稍后...", 
                url: '../TestHandler.ashx',
                method: 'get',
                rownumbers: true,
                fit: false,//填充
                striped: true,//交替背景行
                collapsible: true,
                columns: [[
                    { field: 'ck', checkbox: true },
                    { field: 'UID', title: '序号', width: 100 },
                    { field: 'UCODE', title: '用户编号', width: 100 },
                    { field: 'PWD', title: '密码', width: 100, align: 'right' },
                    { field: 'AGE', title: '年龄', width: 100, align: 'right' },
                ]],
                singleSelect: false,
                selectOnCheck: true,
                checkOnSelect: true
            });
        });

    </script>

以下为HTML内容
<input type="button" value="获取选中行内容" id="btnGetSelectRow" />
    <hr />
    <table id="tt"></table>
    <hr />
    <div id="divContent"></div>

------解决思路----------------------
idField: 'id', 查看下id对应的值是否重复了
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: