implementing select all/none etc
This commit is contained in:
parent
63ce35b38d
commit
59ba938334
1 changed files with 42 additions and 5 deletions
|
@ -65,9 +65,42 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
function emptySelectedLogItems() {
|
||||
var $inputs = $historyContentDiv.find(".his_checkbox").find("input"),
|
||||
id, $tr, $input;
|
||||
|
||||
$.each($inputs, function(index, input) {
|
||||
$input = $(input);
|
||||
$input.prop('checked', false);
|
||||
});
|
||||
selectedLogItems = {};
|
||||
}
|
||||
|
||||
function selectCurrentPage() {
|
||||
var $inputs = $historyContentDiv.find(".his_checkbox").find("input"),
|
||||
id, $tr, $input;
|
||||
|
||||
$.each($inputs, function(index, input) {
|
||||
$input = $(input);
|
||||
$input.prop('checked', true);
|
||||
$tr = $input.parents("tr");
|
||||
id = $tr.data("his-id");
|
||||
addSelectedLogItem(id);
|
||||
});
|
||||
}
|
||||
|
||||
function deselectCurrentPage() {
|
||||
var $inputs = $historyContentDiv.find(".his_checkbox").find("input"),
|
||||
id, $tr, $input;
|
||||
|
||||
$.each($inputs, function(index, input) {
|
||||
$input = $(input);
|
||||
$input.prop('checked', false);
|
||||
$tr = $input.parents("tr");
|
||||
id = $tr.data("his-id");
|
||||
removeSelectedLogItem(id);
|
||||
});
|
||||
}
|
||||
|
||||
function getFileName(ext){
|
||||
var filename = $("#his_date_start").val()+"_"+$("#his_time_start").val()+"m--"+$("#his_date_end").val()+"_"+$("#his_time_end").val()+"m";
|
||||
filename = filename.replace(/:/g,"h");
|
||||
|
@ -129,9 +162,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$.i18n._("Select")+" <span class='caret'></span>" +
|
||||
"</button>" +
|
||||
"<ul class='dropdown-menu'>" +
|
||||
"<li id='sb-select-page'><a href='#'>"+$.i18n._("Select this page")+"</a></li>" +
|
||||
"<li id='sb-dselect-page'><a href='#'>"+$.i18n._("Deselect this page")+"</a></li>" +
|
||||
"<li id='sb-dselect-all'><a href='#'>"+$.i18n._("Deselect all")+"</a></li>" +
|
||||
"<li id='his-select-page'><a href='#'>"+$.i18n._("Select this page")+"</a></li>" +
|
||||
"<li id='his-dselect-page'><a href='#'>"+$.i18n._("Deselect this page")+"</a></li>" +
|
||||
"<li id='his-dselect-all'><a href='#'>"+$.i18n._("Deselect all")+"</a></li>" +
|
||||
"</ul>" +
|
||||
"</div>");
|
||||
|
||||
|
@ -257,6 +290,10 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$toolbar = $historyTableDiv.parents(".dataTables_wrapper").find(".fg-toolbar:first");
|
||||
createToolbarButtons($toolbar);
|
||||
|
||||
$("#his-select-page").click(selectCurrentPage);
|
||||
$("#his-dselect-page").click(deselectCurrentPage);
|
||||
$("#his-dselect-all").click(emptySelectedLogItems);
|
||||
|
||||
return oTable;
|
||||
}
|
||||
|
||||
|
@ -457,7 +494,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
redrawTables();
|
||||
});
|
||||
|
||||
$historyContentDiv.find("#his_trash").click(function(ev){
|
||||
$historyContentDiv.on("click", "#his_trash", function(ev){
|
||||
var items = getSelectedLogItems(),
|
||||
url = baseUrl+"playouthistory/delete-list-items";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue