我有一个动态动作,该动作应从模型中获取数据,具体取决于所单击的列。假设我在交互式网格中有两列,即A列和B列。根据我单击的列,应该执行DA并使用A列或B列中的值执行查询。
DA在双击时处于活动状态,我有以下消息源可从IG模型获取值。
var regionStaticId = $(this.triggeringElement).closest("div.js-apex-region").attr('id');
var grid = apex.region( regionStaticId ).widget().interactiveGrid("getViews", "grid");
var model = grid.model;
var record = grid.getSelectedRecords()[0];
var value;
// Code to find the the clicked column comes here
if (record) {
value = model.getValue(record, columnName);
}
现在,我所能做的就是使用源列的名称向特定的单元格添加一个额外的CSS类。但这在我看来就像是硬编码。这样。
if ($(this.triggeringElement).hasClass('columnA')) {
columnName = 'COLUMN_A';
}
else if ($(this.triggeringElement).hasClass('columnB')) {
columnName = 'COLUMN_B';
}
有没有一种方法可以根据触发元素确定单击的列?
非常感谢您的帮助。