package nckd.jxccl.hr.psms.plugin.form.other;

import kd.bos.form.control.grid.DataGrid;
import kd.bos.form.control.grid.events.BeforeCreateDataGridColumnsEvent;
import kd.bos.form.control.grid.events.BeforeCreateDataGridColumnsListener;
import kd.bos.form.control.grid.events.DataGridBindDataEvent;
import kd.bos.form.control.grid.events.DataGridBindDataListener;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.sdk.plugin.Plugin;

import java.util.EventObject;

/**
 * 动态表单插件
 */
public class KeyBeHavEvalReptFormPlugin extends AbstractFormPlugin implements  Plugin, BeforeCreateDataGridColumnsListener, DataGridBindDataListener {

    /**
     * 注册监听事件
     * @param event
     */
    @Override
    public void registerListener(EventObject event) {
        registerDataGridListener();
    }

    /**
     * 通过事件监听，注册数据表格监听事件
     */
    private void registerDataGridListener() {
        DataGrid dataGrid = this.getControl("reportlistap");
        // 注册创建列监听事件
        dataGrid.addBeforeCreateDataGridColumnsListener(this);
        // 注册绑定数据监听事件
        dataGrid.addBindDataListener(this);

    }

    @Override
    public void beforeCreateDataGridColumns(BeforeCreateDataGridColumnsEvent beforeCreateDataGridColumnsEvent) {

    }

    @Override
    public void dataGridBindData(DataGridBindDataEvent dataGridBindDataEvent) {

    }
}