使用jquery对数据表排序后捕获事件
我遇到了 datatable (http://www.datatables.net)、jQuery 和 Firefox 的问题。
我有一个 jQuery 数据表 (id="equipmentList"
),上面有一个按钮:
<html:button styleId="deleteButton" property="delete" value="<%= buttonDelete %>" disabled="disabled" />
当我对数据表上的列进行排序时,我想禁用一个按钮(按钮 deleteButton< /code>),所以我写了这段代码:
$('#equipmentList th').click( function() {
hideButtonEditAndDelete();
});
function hideButtonEditAndDelete() {
$("#modifyButton").attr("disabled", "disabled");
$( "#deleteButton" ).attr("disabled", "disabled");
//fix for firefox
if($.browser.mozilla){
$("#modifyButton").addClass('ui-state-disabled');
$("#deleteButton").addClass('ui-state-disabled');
}}
一切都很顺利,直到排序结束,因为之后,我的按钮由 jQuery 启用;或其他东西。所以我正在排序顺序末尾寻找捕获事件以禁用我的按钮
I've an issue with a datable (http://www.datatables.net), jQuery and Firefox.
I've a jQuery datatable (id="equipmentList"
) with a button above:
<html:button styleId="deleteButton" property="delete" value="<%= buttonDelete %>" disabled="disabled" />
When i'm sorting a column on the datatable, i want to disable a button (the button deleteButton
), so I wrote this code :
$('#equipmentList th').click( function() {
hideButtonEditAndDelete();
});
function hideButtonEditAndDelete() {
$("#modifyButton").attr("disabled", "disabled");
$( "#deleteButton" ).attr("disabled", "disabled");
//fix for firefox
if($.browser.mozilla){
$("#modifyButton").addClass('ui-state-disabled');
$("#deleteButton").addClass('ui-state-disabled');
}}
Everything goes well until the sort is ending because, after, my button is enabled by jQuery; or something else. so I'm looking for capture event at the end of sorting order to disable my button
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每次重绘表格时都会发出一个回调,并且可以在 fnDrawCallback 上访问:
有关回调的更多信息,请参见:
http://datatables.net/usage/callbacks
There is a callback that is made every time that the table is redrawn and can be accessed on the fnDrawCallback:
More info on callbacks here:
http://datatables.net/usage/callbacks