Commit 1d1d69db authored by hbcui1984's avatar hbcui1984

修复点击列表中的radio/checkbox,不触发change事件的bug

parent a1c9ea81
...@@ -6440,12 +6440,14 @@ var mui = (function(document, undefined) { ...@@ -6440,12 +6440,14 @@ var mui = (function(document, undefined) {
if (input) { if (input) {
// input.click(); // input.click();
input.checked = !input.checked; input.checked = !input.checked;
$.trigger(input, 'change');
} }
} else if (classList.contains('mui-checkbox')) { } else if (classList.contains('mui-checkbox')) {
var input = cell.querySelector('input[type=checkbox]'); var input = cell.querySelector('input[type=checkbox]');
if (input) { if (input) {
// input.click(); // input.click();
input.checked = !input.checked; input.checked = !input.checked;
$.trigger(input, 'change');
} }
} }
}; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<body> <body>
<header class="mui-bar mui-bar-nav"> <header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a> <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">ECahrt 示例</h1> <h1 class="mui-title">chart(EChart图表)</h1>
</header> </header>
<div class="mui-content"> <div class="mui-content">
<div class="mui-content-padded"> <div class="mui-content-padded">
......
...@@ -270,12 +270,20 @@ ...@@ -270,12 +270,20 @@
var checkedValues = []; var checkedValues = [];
checkboxArray.forEach(function(box){ checkboxArray.forEach(function(box){
if(box.checked){ if(box.checked){
// checkedValues.push(box.parentNode.getAttribute('data-value'));
checkedValues.push(box.parentNode.innerText); checkedValues.push(box.parentNode.innerText);
} }
}); });
if(checkedValues.length>0){
mui.alert('你选择了: '+checkedValues); mui.alert('你选择了: '+checkedValues);
}else{
mui.alert('你没选择任何机场');
}
},false); },false);
mui('.mui-indexed-list-inner').on('change', 'input', function() {
var count = list.querySelectorAll('input[type="checkbox"]:checked').length;
var value = count?"确定("+count+")":"确定";
done.innerHTML = value;
});
}); });
</script> </script>
</body> </body>
......
...@@ -123,10 +123,6 @@ ...@@ -123,10 +123,6 @@
<label>主界面移动、菜单不动</label> <label>主界面移动、菜单不动</label>
<input name="style" type="radio" checked="" value="main-move"> <input name="style" type="radio" checked="" value="main-move">
</div> </div>
<div class="mui-input-row mui-radio">
<label>主界面、菜单移动缩放</label>
<input name="style" type="radio" value="main-move-scalable">
</div>
<div class="mui-input-row mui-radio"> <div class="mui-input-row mui-radio">
<label>主界面不动、菜单移动</label> <label>主界面不动、菜单移动</label>
<input name="style" type="radio" value="menu-move"> <input name="style" type="radio" value="menu-move">
...@@ -135,6 +131,10 @@ ...@@ -135,6 +131,10 @@
<label>整体移动</label> <label>整体移动</label>
<input name="style" type="radio" value="all-move"> <input name="style" type="radio" value="all-move">
</div> </div>
<div class="mui-input-row mui-radio">
<label>缩放式侧滑(类手机QQ)</label>
<input name="style" type="radio" value="main-move-scalable">
</div>
</form> </form>
</div> </div>
......
...@@ -122,10 +122,6 @@ ...@@ -122,10 +122,6 @@
<label>主界面移动、菜单不动</label> <label>主界面移动、菜单不动</label>
<input name="style" type="radio" checked="" value="main-move"> <input name="style" type="radio" checked="" value="main-move">
</div> </div>
<div class="mui-input-row mui-radio">
<label>主界面、菜单移动缩放</label>
<input name="style" type="radio" value="main-move-scalable">
</div>
<div class="mui-input-row mui-radio"> <div class="mui-input-row mui-radio">
<label>主界面不动、菜单移动</label> <label>主界面不动、菜单移动</label>
<input name="style" type="radio" value="menu-move"> <input name="style" type="radio" value="menu-move">
...@@ -134,6 +130,10 @@ ...@@ -134,6 +130,10 @@
<label>整体移动</label> <label>整体移动</label>
<input name="style" type="radio" value="all-move"> <input name="style" type="radio" value="all-move">
</div> </div>
<div class="mui-input-row mui-radio">
<label>缩放式侧滑(类手机QQ)</label>
<input name="style" type="radio" value="main-move-scalable">
</div>
</form> </form>
</div> </div>
......
...@@ -6440,12 +6440,14 @@ var mui = (function(document, undefined) { ...@@ -6440,12 +6440,14 @@ var mui = (function(document, undefined) {
if (input) { if (input) {
// input.click(); // input.click();
input.checked = !input.checked; input.checked = !input.checked;
$.trigger(input, 'change');
} }
} else if (classList.contains('mui-checkbox')) { } else if (classList.contains('mui-checkbox')) {
var input = cell.querySelector('input[type=checkbox]'); var input = cell.querySelector('input[type=checkbox]');
if (input) { if (input) {
// input.click(); // input.click();
input.checked = !input.checked; input.checked = !input.checked;
$.trigger(input, 'change');
} }
} }
}; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -359,13 +359,13 @@ ...@@ -359,13 +359,13 @@
</a> </a>
</li> </li>
<li class="mui-table-view-cell"> <li class="mui-table-view-cell">
<a class="mui-navigate-right" href="examples/im-chat.html"> <a class="mui-navigate-right" href="examples/echarts.html">
chat(聊天窗口) chart(EChart 图表)
</a> </a>
</li> </li>
<li class="mui-table-view-cell"> <li class="mui-table-view-cell">
<a class="mui-navigate-right" href="examples/echarts.html"> <a class="mui-navigate-right" href="examples/im-chat.html">
echart(EChart 图表) chat(聊天窗口)
</a> </a>
</li> </li>
<!-- <li id='feedback' class="mui-table-view-cell"> <!-- <li id='feedback' class="mui-table-view-cell">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -436,12 +436,14 @@ ...@@ -436,12 +436,14 @@
if (input) { if (input) {
// input.click(); // input.click();
input.checked = !input.checked; input.checked = !input.checked;
$.trigger(input, 'change');
} }
} else if (classList.contains($.className('checkbox'))) { } else if (classList.contains($.className('checkbox'))) {
var input = cell.querySelector('input[type=checkbox]'); var input = cell.querySelector('input[type=checkbox]');
if (input) { if (input) {
// input.click(); // input.click();
input.checked = !input.checked; input.checked = !input.checked;
$.trigger(input, 'change');
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment