-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新增点击表格内单元格 选中该行变色并当前行CheckBox选中 并单选 #109
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
添加sauce密钥配置
* 优化layui测试 * 添加 layui.data 测试 * 添加laydate测试用例 * 修复ie中focus事件延迟 * 修复ff内测试报错 * 修复ff内测试报错
fix bower error
* 添加 laydate 测试 * 添加 options.format 和 options.value 叠加时的验证 * 修改必须单元测试通过后再进行浏览器测试 * 添加判断css是否加载成功 * 优化 options.elem 测试 * 完善laydate测试 * 更新事件回调测试 * 先把 options.format 注释了, 依赖 master 的修复 * 添加 mock server * 更新404地址 * 使用 show api 来显示日历 * 测试火狐浏览器 * 修复火狐报错 * add callback test case * fix firefox error * fix win var * add window.lay test case * fix firefox test error * add edga test * update `laydate.render({value})` test case * update options.dateTime test case
add code test case
修改 form 示例中邮箱类型错误
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
//初始化$('table[lay-filter="'+ filter +'"]') : $ (ELEM + '[lay-data]')
table.init = function(filter, settings){
settings = settings || {};
var that = this
,elemTable = filter ?
,errorTips = 'Table element property lay-data configuration item has a syntax error: ';
var isOpenCheckOne = settings["isOpenCheckOne"];
if (isOpenCheckOne){
checkBoxInit(that);
}
//单元格选中该行的checkBox选中 只能选择一行
var checkBoxInit = function (table) {
var checkBoxArray = null;
$(document).on('click', 'table tr', function (e){
var evtTarget = e.target || e.srcElement;
if (!$(evtTarget).is('i') ) {
$(this).find(".layui-form-checkbox i").trigger("click");
$(this).addClass('active').siblings().removeClass('active');
var index = $(this).data().index;
var checkBoxTable = $($(document).find("table")[4]);
var div = $(checkBoxTable.find("tr")[index]).find("td")[0];
var checkBox = $(div).find("input");
var divClass = $(div).find("div :eq(1)");
if($(checkBox[0]).prop("checked")){
removeBox(div);
$(this).removeClass('active');
}else{
removeBox(checkBoxArray,index);
checkBoxArray = div;
$(divClass).addClass("layui-form-checked");
$(checkBox[0]).prop("checked",true);
$(this).addClass('active');
}