EAS DEP扩展分录面板添加自定义按钮及分录面板新增、插入、删除监听
参考代码:
EAS DEP扩展分录面板添加自定义按钮
//定义按钮
var btnGenerateKPSQ=new com.kingdee.bos.ctrl.swing.KDWorkButton("开票");
btnGenerateKPSQ.addActionListener(function(e,methodName){
doSomething();
}
});
//通过分录表格获取分录面板
var hkjhDetailPanel=pluginCtx.getKDTable("hkjhentry").getParent().getParent();
var hkjhToolbar =hkjhDetailPanel.getAddNewLineButton().getParent();
var rect = pluginCtx.getKDTable("hkjhentry").getBounds();
//给分录面板添加按钮
hkjhToolbar.add(btnGenerateKPSQ, new com.kingdee.bos.ctrl.swing.KDLayout.Constraints(rect.width-150, 5, 60, 19, 9));
//分录面板新增、插入、删除监听
var addListenerBeforeEvent= { beforeEvent: function(e){
doSomething();
}
}
hkjhDetailPanel.addAddListener(new com.kingdee.eas.framework.client.multiDetail.IDetailPanelListener(addListenerBeforeEvent));
var insertListenerBeforeEvent= { beforeEvent: function(e){
doSomething();
}
}
hkjhDetailPanel.addInsertListener(new com.kingdee.eas.framework.client.multiDetail.IDetailPanelListener(insertListenerBeforeEvent));
var removeListenerBeforeEvent= { beforeEvent: function(e){
doSomething();
}
}
hkjhDetailPanel.addRemoveListener(new com.kingdee.eas.framework.client.multiDetail.IDetailPanelListener(removeListenerBeforeEvent));
推荐阅读