Fix some issues with search, hack to always display options buttons in library view
This commit is contained in:
parent
ab11974799
commit
daf854af04
2 changed files with 19 additions and 14 deletions
|
@ -69,8 +69,7 @@ class Application_Model_Datatables
|
||||||
|
|
||||||
if (isset($data['advSearch']) && $data['advSearch'] === 'true') {
|
if (isset($data['advSearch']) && $data['advSearch'] === 'true') {
|
||||||
|
|
||||||
$librarySetting =
|
$librarySetting = Application_Model_Preference::getCurrentLibraryTableColumnMap();
|
||||||
Application_Model_Preference::getCurrentLibraryTableColumnMap();
|
|
||||||
//$displayColumns[] = 'owner';
|
//$displayColumns[] = 'owner';
|
||||||
|
|
||||||
// map that maps original column position to db name
|
// map that maps original column position to db name
|
||||||
|
|
|
@ -627,22 +627,24 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
},
|
},
|
||||||
"fnStateSave": function (oSettings, oData) {
|
"fnStateSave": function (oSettings, oData) {
|
||||||
localStorage.setItem('datatables-library', JSON.stringify(oData));
|
localStorage.setItem('datatables-library', JSON.stringify(oData));
|
||||||
/*
|
|
||||||
$.ajax({
|
// Sadly, this is necessary because we need to unscramble the colReorder map on the backend
|
||||||
url: baseUrl+"usersettings/set-library-datatable",
|
$.ajax({
|
||||||
type: "POST",
|
url: baseUrl + "usersettings/set-library-datatable",
|
||||||
data: {settings : oData, format: "json"},
|
type: "POST",
|
||||||
dataType: "json"
|
data: {settings: oData, format: "json"},
|
||||||
});
|
dataType: "json"
|
||||||
*/
|
});
|
||||||
|
|
||||||
colReorderMap = oData.ColReorder;
|
colReorderMap = oData.ColReorder;
|
||||||
},
|
},
|
||||||
"fnStateLoad": function fnLibStateLoad(oSettings) {
|
"fnStateLoad": function fnLibStateLoad(oSettings) {
|
||||||
var settings = localStorage.getItem('datatables-library');
|
var settings = JSON.parse(localStorage.getItem('datatables-library'));
|
||||||
|
// Hacky; always set the visibility of the last column (actions buttons) to true
|
||||||
|
settings.abVisCols[settings.abVisCols.length - 1] = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return JSON.parse(settings);
|
return settings;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -690,7 +692,6 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
*/
|
*/
|
||||||
var advSearchFields = $("div#advanced_search").children(':visible');
|
var advSearchFields = $("div#advanced_search").children(':visible');
|
||||||
var advSearchValid = validateAdvancedSearch(advSearchFields);
|
var advSearchValid = validateAdvancedSearch(advSearchFields);
|
||||||
advSearchFields.val("TEST");
|
|
||||||
var type;
|
var type;
|
||||||
aoData.push( { name: "format", value: "json"} );
|
aoData.push( { name: "format", value: "json"} );
|
||||||
aoData.push( { name: "advSearch", value: advSearchValid} );
|
aoData.push( { name: "advSearch", value: advSearchValid} );
|
||||||
|
@ -700,7 +701,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
type = (type === undefined) ? 1 : type;
|
type = (type === undefined) ? 1 : type;
|
||||||
aoData.push( { name: "type", value: type} );
|
aoData.push( { name: "type", value: type} );
|
||||||
|
|
||||||
getUsabilityHint();
|
//getUsabilityHint();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
"dataType": 'json',
|
"dataType": 'json',
|
||||||
|
@ -709,6 +710,11 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
"data": aoData,
|
"data": aoData,
|
||||||
"success": fnCallback,
|
"success": fnCallback,
|
||||||
"error": handleAjaxError
|
"error": handleAjaxError
|
||||||
|
}).done(function(data) {
|
||||||
|
if (data.iTotalRecords > data.iTotalDisplayRecords) {
|
||||||
|
$('#library_empty').hide();
|
||||||
|
$('#library_display').find('tr:has(td.dataTables_empty)').show();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"fnRowCallback": AIRTIME.library.fnRowCallback,
|
"fnRowCallback": AIRTIME.library.fnRowCallback,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue