有没有办法将点击按钮的ID传递给保存处理程序?
例如,我定义了一些自定义按钮:
.fn.editableform.buttons =
'<button type="submit" id="btnIN" type="button" class="editable-IN btn btn-success btn-sm">IN</button>'+
'<button type="submit" id="btnOUT" type="button" class="editable-IN btn btn-success btn-sm">IN</button>'+
'<button type="submit" id="btnAFD" type="button" class="editable-IN btn btn-success btn-sm">IN</button>'+
'<button type="submit" id="btnFFD" type="button" class="editable-IN btn btn-success btn-sm">IN</button>';
然后再说: 这里我抓住提交按钮,我将获得自定义按钮的ID并继续我的自定义代码......
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
.off('save').on('save', function (e, params) {
console.log('test save');
});
感谢您的帮助!