提交 f6dddafd 编写于 作者: C Catouse

* fixed bugs of datatable: check all button disabled when reload.

 * rebuilt js.
上级 130ccb2e
/*!
* ZUI - v1.2.0 - 2014-11-18
* ZUI - v1.2.0 - 2014-11-20
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2014 cnezsoft.com; Licensed MIT
......@@ -6014,29 +6014,17 @@
options.tableClass = options.tableClass || '';
options.tableClass = ' ' + options.tableClass + ' table-datatable';
if ($e.hasClass('table-bordered'))
$.each(['bordered', 'condensed', 'striped', 'condensed', 'fixed'], function(idx, cls)
{
options.tableClass += ' table-bordered';
}
cls = 'table-' + cls;
if($e.hasClass(cls)) options.tableClass += ' ' + cls;
});
if ($e.hasClass('table-hover') || options.rowHover)
{
options.tableClass += ' table-hover';
}
if ($e.hasClass('table-striped'))
{
options.tableClass += ' table-striped';
}
if ($e.hasClass('table-condensed'))
{
options.tableClass += ' table-condensed';
}
if ($e.hasClass('table-fixed'))
{
options.tableClass += ' table-fixed';
}
this.options = options;
};
......@@ -6194,7 +6182,7 @@
dataRowSpan = '<div class="datatable-rows-span datatable-span"><div class="datatable-wrapper"><table class="table"></table></div></div>',
dataHeadSpan = '<div class="datatable-head-span datatable-span"><div class="datatable-wrapper"><table class="table"><thead></thead></table></div></div>';
$datatable.children('.datatable-head, .datatable-rows').remove();
$datatable.children('.datatable-head, .datatable-rows, .scroll-wrapper').remove();
// Set css class to datatable by options
$datatable.toggleClass('sortable', options.sortable);
......@@ -6610,7 +6598,8 @@
syncChecks();
});
this.$datatable.on('click', '.check-all', function()
var checkAllEventName = 'click.zui.datatable.check-all';
this.$datatable.off(checkAllEventName).on(checkAllEventName, '.check-all', function()
{
$rows.toggleClass(checkedClass, $(this).toggleClass('checked').hasClass('checked'));
syncChecks();
......
此差异已折叠。
/*!
* ZUI - v1.2.0 - 2014-11-18
* ZUI - v1.2.0 - 2014-11-20
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2014 cnezsoft.com; Licensed MIT
......@@ -95,29 +95,17 @@
options.tableClass = options.tableClass || '';
options.tableClass = ' ' + options.tableClass + ' table-datatable';
if ($e.hasClass('table-bordered'))
$.each(['bordered', 'condensed', 'striped', 'condensed', 'fixed'], function(idx, cls)
{
options.tableClass += ' table-bordered';
}
cls = 'table-' + cls;
if($e.hasClass(cls)) options.tableClass += ' ' + cls;
});
if ($e.hasClass('table-hover') || options.rowHover)
{
options.tableClass += ' table-hover';
}
if ($e.hasClass('table-striped'))
{
options.tableClass += ' table-striped';
}
if ($e.hasClass('table-condensed'))
{
options.tableClass += ' table-condensed';
}
if ($e.hasClass('table-fixed'))
{
options.tableClass += ' table-fixed';
}
this.options = options;
};
......@@ -275,7 +263,7 @@
dataRowSpan = '<div class="datatable-rows-span datatable-span"><div class="datatable-wrapper"><table class="table"></table></div></div>',
dataHeadSpan = '<div class="datatable-head-span datatable-span"><div class="datatable-wrapper"><table class="table"><thead></thead></table></div></div>';
$datatable.children('.datatable-head, .datatable-rows').remove();
$datatable.children('.datatable-head, .datatable-rows, .scroll-wrapper').remove();
// Set css class to datatable by options
$datatable.toggleClass('sortable', options.sortable);
......@@ -691,7 +679,8 @@
syncChecks();
});
this.$datatable.on('click', '.check-all', function()
var checkAllEventName = 'click.zui.datatable.check-all';
this.$datatable.off(checkAllEventName).on(checkAllEventName, '.check-all', function()
{
$rows.toggleClass(checkedClass, $(this).toggleClass('checked').hasClass('checked'));
syncChecks();
......
......@@ -163,7 +163,7 @@
<script>
$(function()
{
$('#datatable').datatable({fixedHeaderOffset: 41});
$('#datatable').datatable({fixedHeaderOffset: 41, checkable: true});
$('#dtFromData').datatable
({
customizable: true, checkable: true, sortable: true,
......
/*!
* ZUI - v1.2.0 - 2014-11-18
* ZUI - v1.2.0 - 2014-11-20
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2014 cnezsoft.com; Licensed MIT
......@@ -6014,29 +6014,17 @@
options.tableClass = options.tableClass || '';
options.tableClass = ' ' + options.tableClass + ' table-datatable';
if ($e.hasClass('table-bordered'))
$.each(['bordered', 'condensed', 'striped', 'condensed', 'fixed'], function(idx, cls)
{
options.tableClass += ' table-bordered';
}
cls = 'table-' + cls;
if($e.hasClass(cls)) options.tableClass += ' ' + cls;
});
if ($e.hasClass('table-hover') || options.rowHover)
{
options.tableClass += ' table-hover';
}
if ($e.hasClass('table-striped'))
{
options.tableClass += ' table-striped';
}
if ($e.hasClass('table-condensed'))
{
options.tableClass += ' table-condensed';
}
if ($e.hasClass('table-fixed'))
{
options.tableClass += ' table-fixed';
}
this.options = options;
};
......@@ -6194,7 +6182,7 @@
dataRowSpan = '<div class="datatable-rows-span datatable-span"><div class="datatable-wrapper"><table class="table"></table></div></div>',
dataHeadSpan = '<div class="datatable-head-span datatable-span"><div class="datatable-wrapper"><table class="table"><thead></thead></table></div></div>';
$datatable.children('.datatable-head, .datatable-rows').remove();
$datatable.children('.datatable-head, .datatable-rows, .scroll-wrapper').remove();
// Set css class to datatable by options
$datatable.toggleClass('sortable', options.sortable);
......@@ -6610,7 +6598,8 @@
syncChecks();
});
this.$datatable.on('click', '.check-all', function()
var checkAllEventName = 'click.zui.datatable.check-all';
this.$datatable.off(checkAllEventName).on(checkAllEventName, '.check-all', function()
{
$rows.toggleClass(checkedClass, $(this).toggleClass('checked').hasClass('checked'));
syncChecks();
......
此差异已折叠。
......@@ -88,29 +88,17 @@
options.tableClass = options.tableClass || '';
options.tableClass = ' ' + options.tableClass + ' table-datatable';
if ($e.hasClass('table-bordered'))
$.each(['bordered', 'condensed', 'striped', 'condensed', 'fixed'], function(idx, cls)
{
options.tableClass += ' table-bordered';
}
cls = 'table-' + cls;
if($e.hasClass(cls)) options.tableClass += ' ' + cls;
});
if ($e.hasClass('table-hover') || options.rowHover)
{
options.tableClass += ' table-hover';
}
if ($e.hasClass('table-striped'))
{
options.tableClass += ' table-striped';
}
if ($e.hasClass('table-condensed'))
{
options.tableClass += ' table-condensed';
}
if ($e.hasClass('table-fixed'))
{
options.tableClass += ' table-fixed';
}
this.options = options;
};
......@@ -268,7 +256,7 @@
dataRowSpan = '<div class="datatable-rows-span datatable-span"><div class="datatable-wrapper"><table class="table"></table></div></div>',
dataHeadSpan = '<div class="datatable-head-span datatable-span"><div class="datatable-wrapper"><table class="table"><thead></thead></table></div></div>';
$datatable.children('.datatable-head, .datatable-rows').remove();
$datatable.children('.datatable-head, .datatable-rows, .scroll-wrapper').remove();
// Set css class to datatable by options
$datatable.toggleClass('sortable', options.sortable);
......@@ -684,7 +672,8 @@
syncChecks();
});
this.$datatable.on('click', '.check-all', function()
var checkAllEventName = 'click.zui.datatable.check-all';
this.$datatable.off(checkAllEventName).on(checkAllEventName, '.check-all', function()
{
$rows.toggleClass(checkedClass, $(this).toggleClass('checked').hasClass('checked'));
syncChecks();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册