|
|
@ -56,49 +56,31 @@ $(function() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
/*$("#books-table").bootstrapTable({
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test = $("#books-table").bootstrapTable('getOptions');
|
|
|
|
|
|
|
|
var column = test.columns[0]
|
|
|
|
|
|
|
|
column.forEach(function(item){
|
|
|
|
|
|
|
|
if ('editableValidate' in item) {
|
|
|
|
|
|
|
|
item.editable = {
|
|
|
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
|
|
|
validate: function (value) { if($.trim(value) == '') return 'This field is required'; },
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#books-table").bootstrapTable('refreshOptions', {columns: [column]});*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var column = [];
|
|
|
|
var column = [];
|
|
|
|
$('#table1 > thead > tr > th').each(function(){
|
|
|
|
$("#books-table > thead > tr > th").each(function() {
|
|
|
|
if ($(this).attr('data-edit')) {
|
|
|
|
var element = {};
|
|
|
|
if ($(this).attr('data-edit-validate')) {
|
|
|
|
if ($(this).attr("data-edit")) {
|
|
|
|
column.push({
|
|
|
|
element = {
|
|
|
|
editable: {
|
|
|
|
editable: {
|
|
|
|
mode: 'inline',
|
|
|
|
mode: "inline",
|
|
|
|
emptytext: "<span class='glyphicon glyphicon-plus'></span>",
|
|
|
|
emptytext: "<span class='glyphicon glyphicon-plus'></span>",
|
|
|
|
validate: function (value) { if($.trim(value) == '') return 'This field is required'; },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
var validateText = $(this).attr("data-edit-validate");
|
|
|
|
column.push({
|
|
|
|
if (validateText) {
|
|
|
|
editable: {
|
|
|
|
element.editable.validate = function (value) {
|
|
|
|
mode: 'inline',
|
|
|
|
if ($.trim(value) === "") return validateText;
|
|
|
|
emptytext: "<span class='glyphicon glyphicon-plus'></span>",
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
column.push({});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
column.push(element);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$("#table1").bootstrapTable({
|
|
|
|
$("#books-table").bootstrapTable({
|
|
|
|
sidePagination: "server",
|
|
|
|
sidePagination: "server",
|
|
|
|
pagination: true,
|
|
|
|
pagination: true,
|
|
|
|
paginationDetailHAlign: " hidden",
|
|
|
|
paginationDetailHAlign: " hidden",
|
|
|
|
paginationHAlign: "left",
|
|
|
|
paginationHAlign: "left",
|
|
|
|
/*url: window.location.pathname + "/../../ajax/listbooks",*/
|
|
|
|
|
|
|
|
idField: "id",
|
|
|
|
idField: "id",
|
|
|
|
search: true,
|
|
|
|
search: true,
|
|
|
|
showColumns: true,
|
|
|
|
showColumns: true,
|
|
|
@ -109,56 +91,11 @@ $(function() {
|
|
|
|
maintainMetaData: true,
|
|
|
|
maintainMetaData: true,
|
|
|
|
responseHandler: responseHandler,
|
|
|
|
responseHandler: responseHandler,
|
|
|
|
columns: column,
|
|
|
|
columns: column,
|
|
|
|
/*editable-mode="inline"
|
|
|
|
|
|
|
|
editable-emptytext="<span class='glyphicon glyphicon-plus'></span>">*/
|
|
|
|
|
|
|
|
/*columns: [
|
|
|
|
|
|
|
|
{},
|
|
|
|
|
|
|
|
{}, {
|
|
|
|
|
|
|
|
editable: {
|
|
|
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
|
|
|
emptytext: "<span class='glyphicon glyphicon-plus'></span>",
|
|
|
|
|
|
|
|
validate: function (value) { if($.trim(value) == '') return 'This field is required'; },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
editable: {
|
|
|
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
|
|
|
validate: function (value) { if($.trim(value) == '') return 'This field is required'; },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
editable: {
|
|
|
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
|
|
|
validate: function (value) { if($.trim(value) == '') return 'This field is required'; },
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
editable: {
|
|
|
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
|
|
|
emptytext: "<span class='glyphicon glyphicon-plus'></span>",
|
|
|
|
|
|
|
|
validate: function (value) { if($.trim(value) == '') return 'This field is required'; },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
editable: {
|
|
|
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
|
|
|
emptytext: "<span class='glyphicon glyphicon-plus'></span>",
|
|
|
|
|
|
|
|
validate: function (value) { if($.trim(value) == '') return 'This field is required'; },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
editable: {
|
|
|
|
|
|
|
|
mode: 'inline',
|
|
|
|
|
|
|
|
emptytext: "<span class='glyphicon glyphicon-plus'></span>",
|
|
|
|
|
|
|
|
validate: function (value) { if($.trim(value) == '') return 'This field is required'; },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}],*/
|
|
|
|
|
|
|
|
formatNoMatches: function () {
|
|
|
|
formatNoMatches: function () {
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/*var $table = $('#books-table');
|
|
|
|
|
|
|
|
$('#books-table').bootstrapTable('getOptions')*/
|
|
|
|
|
|
|
|
/*$('#books-table').bootstrapTable('editable')*/
|
|
|
|
|
|
|
|
/*{ field: 'aimValue', title: 'Aim<br>Value', class: 'danger',editable: { mode: 'inline', validate: function (v) { return validateData(this, v); }, }, },*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#domain_allow_submit").click(function(event) {
|
|
|
|
$("#domain_allow_submit").click(function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
event.preventDefault();
|
|
|
|
$("#domain_add_allow").ajaxForm();
|
|
|
|
$("#domain_add_allow").ajaxForm();
|
|
|
@ -173,6 +110,7 @@ $(function() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("#domain-allow-table").bootstrapTable({
|
|
|
|
$("#domain-allow-table").bootstrapTable({
|
|
|
|
formatNoMatches: function () {
|
|
|
|
formatNoMatches: function () {
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
@ -398,9 +336,3 @@ function responseHandler(res) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function validato(value) {
|
|
|
|
|
|
|
|
if($.trim(value) == '') return 'This field is required';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*function validateVal(value) { if($.trim(value) == '') return 'This field is required'; }*/
|
|
|
|
|
|
|
|