-changes to list view. Framework so that we may change selected day

-changes to add-user. Started implementing Vladimirs design.
This commit is contained in:
mkonecny 2011-02-07 19:03:14 -05:00
parent e9691f9a4c
commit bc5b9efb4b
19 changed files with 351 additions and 69 deletions

View file

@ -0,0 +1,26 @@
$(document).ready(function() {
$('#users_datatable').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/User/get-user-data-table-info/format/json",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
},
"aoColumns": [
/* Id */ { "sName": "id", "bSearchable": false, "bVisible": false },
/* user name */ { "sName": "login" },
/* user type */ { "sName": "type", "bSearchable": false },
/* del button */ { "sName": "first_name", "bSearchable": false, "bSortable": false}
],
"bJQueryUI": true,
"bAutoWidth": false,
"bLengthChange": false,
//"bFilter": false
});
});

View file

@ -0,0 +1 @@
var viewType = "day";

View file

@ -99,7 +99,6 @@ function createDataGrid(){
}
var viewType = "now" //"day";
var mainLoopRegistered = false;
function setViewType(type){
@ -111,8 +110,29 @@ function setViewType(type){
init2();
}
function getDateString(){
var date0 = $("#datepicker").datepicker("getDate");
return (date0.getFullYear() + "-" + date0.getMonth() + "-" + date0.getDate());
}
function getAJAXURL(){
var url = "/Nowplaying/get-data-grid-data/format/json/view/"+viewType;
if (viewType == "day"){
url += "/date/" + getDateString();
}
return url;
}
function init2(){
$.ajax({ url: "/Nowplaying/get-data-grid-data/format/json/view/" + viewType, dataType:"json", success:function(data){
if (!mainLoopRegistered){
setTimeout(init2, 5000);
mainLoopRegistered = true;
}
$.ajax({ url: getAJAXURL(), dataType:"json", success:function(data){
datagridData = data.entries;
createDataGrid();
}});
@ -121,13 +141,14 @@ function init2(){
registered = true;
registerSongEndListener(notifySongEnd);
}
if (!mainLoopRegistered){
setTimeout(init2, 5000);
mainLoopRegistered = true;
}
}
$(document).ready(function() {
init2();
if (viewType == "day"){
$("#datepicker").datepicker();
var date = new Date();
$("#datepicker").datepicker("setDate", date);
}
init2();
});

View file

@ -0,0 +1 @@
var viewType = "now";