update ListCalendar

This commit is contained in:
rlx 2011-10-03 16:37:05 +00:00
parent d51de58009
commit a5a833f3c1
2 changed files with 24 additions and 13 deletions

View file

@ -9,15 +9,11 @@ Ox.ListCalendar = function(options, self) {
self = self || {};
var that = Ox.Element({}, self)
.defaults({
addPlace: null,
editPlace: null,
events: [],
height: 256,
labels: false,
pageLength: 100,
places: null,
removePlace: null,
selected: [],
sort: [{key: 'geoname', operator: '+'}],
sort: [{key: 'name', operator: '+'}],
width: 256
})
.options(options || {})
@ -172,14 +168,14 @@ Ox.ListCalendar = function(options, self) {
columnsRemovable: true,
columnsVisible: true,
//items: Ox.clone(self.options.places),
items: self.options.places,
items: self.options.events,
pageLength: self.options.pageLength,
scrollbarVisible: true,
sort: self.options.sort
})
.bindEvent({
'delete': removeItem,
init: initList,
init: initList, // fixme: won't fire from static list
key_0: function() {
self.$calendar.panToEvent();
},
@ -205,6 +201,11 @@ Ox.ListCalendar = function(options, self) {
self.$status = Ox.Element()
.css({paddingTop: '2px', margin: 'auto', fontSize: '9px', textAlign: 'center'})
.html(
Ox.formatNumber(self.options.events.length) + ' Event' + (
self.options.events.length == 1 ? '' : 's'
)
)
.appendTo(self.$listStatusbar);
self.$calendar = Ox.Element();
@ -214,7 +215,7 @@ Ox.ListCalendar = function(options, self) {
});
self.$placeForm = Ox.Form({
items: self.$placeFormItems,
items: [],
width: 240
})
.css({margin: '8px'})
@ -289,14 +290,22 @@ Ox.ListCalendar = function(options, self) {
);
function initList() {
function initList(data) {
self.$status.html(
Ox.formatNumber(data.items) + ' Event' + (
data.items == 1 ? '' : 's'
)
);
}
function openItem() {
}
function removeItem() {
}
function selectItem() {
}
@ -320,4 +329,6 @@ Ox.ListCalendar = function(options, self) {
});
}
return that;
};

View file

@ -522,8 +522,8 @@ Ox.ListMap = function(options, self) {
.appendTo(self.$placeForm);
self.$placeStatusbar = Ox.Bar({
size: 24
});
size: 24
});
self.$newPlaceButton = Ox.Button({
title: 'New Place',