/*
 * The Hefei Ceshi RDC(Research and Development Centre) Group.
 * __________________
 *
 *    Copyright 2015-2020
 *    All Rights Reserved.
 *
 *    NOTICE:  All information contained herein is, and remains
 *    the property of Ceshi Company and its suppliers,
 *    if any.
 */

/**
 *
 * @author BOGON
 * @version 1.0
 */
var page = {
    bindEvent: function () {
    },
    initDatagrid: function () {
        $.ajax({
            type: 'POST',
            url: g.ctx + 'pc/spe/supAppraiseDimension/rest/listAll',
            async: false,
            success: function (data) {
                $("#tb").datagrid({
                    data: data,
                    singleSelect: false,
                    checkbox: true,
                    columns: [[
                        {
                            field: 'ck',
                            checkbox: true
                        },
                        {
                            field: 'dimensionId',
                            hidden: true
                        },
                        {
                            field: 'dimensionCode',
                            hidden: true
                        },
                        {
                            field: 'dimensionName',
                            title: '考核维度',
                            width: 270
                        }
                    ]],
                    onLoadSuccess: function (ddat) {
                        var seled = selected.split(",");
                        $.each(ddat.rows, function (index, item) {
                            if (seled.indexOf(item.dimensionCode) != -1) {
                                $("#tb").datagrid('checkRow', index);
                            }
                        });
                    }
                });
            }
        });
    },
    getSelectedRows: function () {
        return $("#tb").datagrid('getChecked');
    }
}
$(function () {
    page.bindEvent();
    page.initDatagrid();
})