CC-3174 : showbuilder
remembering state for the timeline datatable.
This commit is contained in:
parent
5703508beb
commit
2aae318a5a
|
@ -16,6 +16,8 @@ class PreferenceController extends Zend_Controller_Action
|
|||
->addActionContext('get-liquidsoap-status', 'json')
|
||||
->addActionContext('get-library-datatable', 'json')
|
||||
->addActionContext('set-library-datatable', 'json')
|
||||
->addActionContext('get-timeline-datatable', 'json')
|
||||
->addActionContext('set-timeline-datatable', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
|
@ -340,17 +342,27 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$settings = $request->getParam("settings");
|
||||
|
||||
$data = serialize($settings);
|
||||
Logging::log("library datatable");
|
||||
Logging::log($data);
|
||||
|
||||
Application_Model_Preference::SetValue("library_datatable", $data, true);
|
||||
|
||||
}
|
||||
|
||||
public function getLibraryDatatableAction() {
|
||||
|
||||
$data = Application_Model_Preference::GetValue("library_datatable", true);
|
||||
$this->view->settings = unserialize($data);
|
||||
}
|
||||
|
||||
public function setTimelineDatatableAction() {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$settings = $request->getParam("settings");
|
||||
|
||||
$data = serialize($settings);
|
||||
Application_Model_Preference::SetValue("timeline_datatable", $data, true);
|
||||
}
|
||||
|
||||
public function getTimelineDatatableAction() {
|
||||
|
||||
$data = Application_Model_Preference::GetValue("timeline_datatable", true);
|
||||
$this->view->settings = unserialize($data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,6 +282,63 @@ $(document).ready(function() {
|
|||
"bServerSide": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
|
||||
"bStateSave": true,
|
||||
"fnStateSaveParams": function (oSettings, oData) {
|
||||
//remove oData components we don't want to save.
|
||||
delete oData.oSearch;
|
||||
delete oData.aoSearchCols;
|
||||
},
|
||||
"fnStateSave": function (oSettings, oData) {
|
||||
|
||||
$.ajax({
|
||||
url: "/preference/set-timeline-datatable",
|
||||
type: "POST",
|
||||
data: {settings : oData, format: "json"},
|
||||
dataType: "json",
|
||||
success: function(){},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
var x;
|
||||
}
|
||||
});
|
||||
},
|
||||
"fnStateLoad": function (oSettings) {
|
||||
var o;
|
||||
|
||||
$.ajax({
|
||||
url: "/preference/get-timeline-datatable",
|
||||
type: "GET",
|
||||
data: {format: "json"},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json){
|
||||
o = json.settings;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
var x;
|
||||
}
|
||||
});
|
||||
|
||||
return o;
|
||||
},
|
||||
"fnStateLoadParams": function (oSettings, oData) {
|
||||
var i,
|
||||
length,
|
||||
a = oData.abVisCols;
|
||||
|
||||
//putting serialized data back into the correct js type to make
|
||||
//sure everything works properly.
|
||||
for (i = 0, length = a.length; i < length; i++) {
|
||||
a[i] = (a[i] === "true") ? true : false;
|
||||
}
|
||||
|
||||
a = oData.ColReorder;
|
||||
for (i = 0, length = a.length; i < length; i++) {
|
||||
a[i] = parseInt(a[i], 10);
|
||||
}
|
||||
|
||||
oData.iCreate = parseInt(oData.iCreate, 10);
|
||||
},
|
||||
|
||||
"fnServerData": fnServerData,
|
||||
"fnRowCallback": fnShowBuilderRowCallback,
|
||||
|
|
Loading…
Reference in New Issue