Prerelease 11.10.2017

fix in js
This commit is contained in:
PhantomVl 2017-10-11 20:07:22 +03:00
parent 8ad29607f4
commit d1e4d340c4
2 changed files with 10 additions and 4 deletions

View file

@ -408,9 +408,10 @@ $(document).ready(function () {
}
if (($(this).data('id') === 'model_enabled') || ($(this).data('id') === 'model_disabled')) {
var dev_cmd = $(this).data('id');
var tab_name ='#'+$(this).data('table');
var datas = '';
var i = 0;
$('table').bootstrapTable('getSelections').forEach(function (entry) {
$(tab_name).bootstrapTable('getSelections').forEach(function (entry) {
datas = datas + 'model[' + i + ']=' + entry['model'] + '&';
i++;
});
@ -512,7 +513,9 @@ $("table").on('check.bs.table', function (e, row) {
});
$("table").on('uncheck.bs.table', function (e, row) {
var id_fld = $(this).data('id');
var id_count = $("table").bootstrapTable('getAllSelections').length;
var id_parent = '#'+$(this).parent().find('table').attr('id');
// console.log(id_parent);
var id_count = $(id_parent).bootstrapTable('getAllSelections').length;
if (id_count < 1) {
$(".btn-tab-select").each(function () {
$(this).attr('disabled', true);
@ -522,6 +525,9 @@ $("table").on('uncheck.bs.table', function (e, row) {
});
$("table").on('uncheck-all.bs.table', function (rows) {
var id_fld = $(this).data('id');
var id_parent = '#'+$(this).parent().find('table').attr('id');
// console.log(id_parent);
// var id_count = $(id_parent).bootstrapTable('getAllSelections').length;
var id_count = $("table").bootstrapTable('getAllSelections').length;
if (id_count < 1) {
$(".btn-tab-select").each(function () {

View file

@ -14,10 +14,10 @@
<div class="display no-border">
<div id="toolbar-model">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target=".add_new_model"><i class="fa fa-bolt"></i> <?php echo _("Add model"); ?></button>
<button data-id="model_disabled" class="btn btn-danger sccp_update btn-tab-select" data-type="sccp_model" disabled data-section="all">
<button data-id="model_disabled" class="btn btn-danger sccp_update btn-tab-select" data-type="sccp_model" data-table="table-models" disabled data-section="all">
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Disabled') ?></span>
</button>
<button data-id="model_enabled" class="btn btn-danger sccp_update btn-tab-select" data-type="sccp_model" disabled data-section="all">
<button data-id="model_enabled" class="btn btn-danger sccp_update btn-tab-select" data-table="table-models" data-type="sccp_model" disabled data-section="all">
<i class="glyphicon glyphicon-active"></i> <span><?php echo _('Enabled') ?></span>
</button>
<div class="btn-group">