Improvements for limit tags

This commit is contained in:
Ozzieisaacs
2020-01-01 17:30:08 +01:00
parent 1da4efec86
commit d9adb4fc94
10 changed files with 276 additions and 27 deletions
+76
View File
@@ -93,6 +93,73 @@ $(function() {
var domainId = $(e.relatedTarget).data("domain-id");
$(e.currentTarget).find("#btndeletedomain").data("domainId", domainId);
});
$('#restrictModal').on('hidden.bs.modal', function () {
$('#restrict-elements-table').bootstrapTable('destroy');
});
// $('#table').bootstrapTable('destroy');
function startTable(type){
$("#restrict-elements-table").bootstrapTable({
formatNoMatches: function () {
return "";
},
url:window.location.pathname + "/../../ajax/listrestriction/" + type,
onClickCell: function (field, value, row, $element) {
// ...
if(field == 3){
$.ajax ({
type: 'Post',
data: 'id=' + row.id + '&type=' + row.type + "&Element=" + row.Element,
url: window.location.pathname + "/../../ajax/deleterestriction/" + type,
async: true,
timeout: 900,
success:function(data) {
$.ajax({
method:"get",
url: window.location.pathname + "/../../ajax/listrestriction/"+type,
async: true,
timeout: 900,
success:function(data) {
$("#restrict-elements-table").bootstrapTable("load", data);
}
});
}
});
}
},
striped: false
});
$("[id^=submit_]").click(function(event) {
event.preventDefault();
console.log($(this)[0].name)
$.ajax({
url: window.location.pathname + "/../../ajax/addrestriction/"+type,
type: 'Post',
data: $(this).closest("form").serialize() + "&" + $(this)[0].name + "=",
success: function () {
$.ajax ({
method:"get",
url: window.location.pathname + "/../../ajax/listrestriction/"+type,
async: true,
timeout: 900,
success:function(data) {
$("#restrict-elements-table").bootstrapTable("load", data);
}
});
}
});
return;
});
}
$('#get_column_values').on('click',function()
{
startTable(1);
});
$('#get_tags').on('click',function()
{
startTable(0);
});
});
/* Function for deleting domain restrictions */
@@ -104,3 +171,12 @@ function TableActions (value, row, index) {
"</a>"
].join("");
}
/* Function for deleting domain restrictions */
function RestrictionActions (value, row, index) {
return [
"<div class=\"danger remove\" data-restriction-id=\"" + row.id + "\" title=\"Remove\">",
"<i class=\"glyphicon glyphicon-trash\"></i>",
"</div>"
].join("");
}