mirror of https://github.com/layui/layui
优化 table 单选框在特殊场景下的选中逻辑 (#1406)
修复表头属性type:'radio', fixed: 'right'时选择效果无效问题,但是不影响数据返回pull/1413/head
commit
f437d48138
|
@ -1596,8 +1596,12 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
radio: 'layTableRadio',
|
radio: 'layTableRadio',
|
||||||
checkbox: 'layTableCheckbox'
|
checkbox: 'layTableCheckbox'
|
||||||
}[opts.type] || 'checkbox') +'"]:not(:disabled)');
|
}[opts.type] || 'checkbox') +'"]:not(:disabled)');
|
||||||
|
var checkedSameElem = checkedElem.last();
|
||||||
|
var fixRElem = checkedSameElem.closest(ELEM_FIXR);
|
||||||
|
|
||||||
checkedElem.prop('checked', getChecked(checkedElem.last().prop('checked')));
|
( opts.type === 'radio' && fixRElem.hasClass(HIDE)
|
||||||
|
? checkedElem.first()
|
||||||
|
: checkedElem ).prop('checked', getChecked(checkedSameElem.prop('checked')));
|
||||||
|
|
||||||
that.syncCheckAll();
|
that.syncCheckAll();
|
||||||
that.renderForm(opts.type);
|
that.renderForm(opts.type);
|
||||||
|
|
Loading…
Reference in New Issue