为什么复选框滑块不能与鼠标一起工作
why does the checkbox slider does not works with mouse?
我有以下数据表元素:
<div id="searchable_wrapper" class="dataTables_wrapper form-inline" role="grid">
<table id="termGridParametersTable" class="table table-bordered table-hover table-striped dataTable" aria-describedby="searchable_info">
<thead>
<tr>
<th th:text="#{gen.code}" />
<th th:text="#{gen.desc}" />
<th th:text="#{termGrid.paramType}" />
<th th:text="#{termGrid.paramValue}" />
</tr>
</thead>
<tbody>
<tr th:each="gridEffectiveParam : ${effectivePojo.effectiveParameters}">
<td th:text="${gridEffectiveParam.parameter.code}" />
<td th:text="${gridEffectiveParam.parameter.description}" />
<td th:text="#{'termGrid.' + ${gridEffectiveParam.parameter.contractParameterType}}" />
<td>
<th:block th:if="${#strings.equals(gridEffectiveParam.parameterType,'paramType.boolean')}">
<input type="checkbox" name="booleanValue" th:onchange="'updateValue(''' + ${gridEffectiveParam.id} + ''', this);'" th:checked="${gridEffectiveParam.booleanValue}" class="checkbox-slider colored-darkorange" />
<span class="text"></span>
</th:block>
<th:block th:if="${#strings.equals(gridEffectiveParam.parameterType,'paramType.float')}">
<input class="form-control" type="text" id="floatValue" th:onblur="'updateValue(''' + ${gridEffectiveParam.id} + ''', this);'" th:value="${gridEffectiveParam.value}" />
</th:block>
<th:block th:if="${#strings.equals(gridEffectiveParam.parameterType,'paramType.integer')}">
<input class="form-control" type="text" id="intValue" th:onblur="'updateValue(''' + ${gridEffectiveParam.id} + ''', this);'" th:value="${gridEffectiveParam.value}" />
</th:block>
</td>
</tr>
</tbody>
</table>
</div>
updateValue()
javascript函数运行良好,如下所示:
function updateValue(id,value) {
$.ajax({
url: "updateEffectiveParameter?id=" + id + "&value=" + value.value,
type: "GET",
datatype:"json",
contentType: 'application/json',
mimeType: 'application/json',
success: function(response){
if(!response){
bootbox.alert("a problem occured");
}
},
error: function(e){
alert('error message');
}
});
但是我只能通过点击前一个字段的TAB
并点击空格键来改变复选框滑动条的值。没有鼠标选择
我理解这与DataTables JS组件有关。
这里的问题是什么?如何使它工作?
您将th:onchange
用于第一个复选框,th:onblur
用于第二个和第三个复选框。我猜你需要使用th:onchange
在所有三个
相关文章:
- EaseJS拖放;放下(动画CC)电影剪辑的鼠标坐标
- 转义符不能与innerHTML一起使用
- 当鼠标悬停在文本中的单词上时显示警报
- JsFiddle上的鼠标事件不起作用
- 每当您在选择器内移动鼠标时,悬停功能就会重复
- 如何在鼠标悬停时在另一个图像上滑动图像.
- 鼠标悬停事件影响列表中所有行中的按钮,而不仅仅是特定按钮
- 高亮显示与数组字符串一起使用时文本插件中断
- 将鼠标旋转限制为特定的度数
- 跟踪jqplot垂直折线图的鼠标位置
- setTimeout可以与闭包内的函数一起使用吗
- 将依赖外部库的UMD模块与browserfy捆绑在一起
- Highcharts colorsByPoint与系列中的线性渐变一起使用时不起作用
- 将 import.io 与鼠标悬停文本一起使用
- ASP.NET 网格视图 - 允许从控制键按下和鼠标左键一起单击多选
- 为什么复选框滑块不能与鼠标一起工作
- 在IE8中,鼠标滚轮不能与jScrollPane一起工作(没有iframe!)
- 似乎无法让鼠标悬停事件与地图框一起工作
- 当鼠标悬停在页脚上时,如何停止页脚和下载按钮一起移动
- 在jquery中:事件键和鼠标在一起