easyui DataGrid checkbox 根据后台传递过来的数据进行勾选

本文介绍了如何在EasyUI的DataGrid中,利用onLoadSuccess事件根据后台返回的数据动态设置复选框的状态。通过判断后台传递的数据显示,当值为'1'时,对应的表格行会被设置为选中状态。
摘要由CSDN通过智能技术生成
function loadMessage() {
    $('#pressure').datagrid({
        height: 500,
        url: '/Home/RealtimeData',
        method: 'POST',
        //queryParams: { 'id': OBJECTID },
        idField: 'ID',
        striped: true,
        fitColumns: true,
        singleSelect: false,
        rownumbers: true,
        pagination: false,
        nowrap: false,
        pageSize: 10,
        pageList: [10, 20, 50, 100, 150, 200],
        showFooter: true,
        columns: [[
            { field: 'ck', checkbox: true },
            { field: 'ElementId', title: 'ElementId', width: 180, align: 'left' },
            { field: 'Label', title: 'Label', width: 180, align: 'left' },
            { field: 'Meter_Name', title: 'Meter_Name', width: 180, align: 'left' },
            { field: 'Station_Un', title: 'Station_Un', width: 180,
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值