more list

This commit is contained in:
Rolux 2010-06-30 23:41:27 +02:00
parent 525d880760
commit 82f1fc8b9a
2 changed files with 25 additions and 13 deletions

View File

@ -532,6 +532,8 @@ requires
Ox.Request = function() {
// chained requests, make cancelable: id = 4.7.9
var cache = {},
pending = {},
requests = {},
@ -2477,7 +2479,7 @@ requires
if (!Ox.isUndefined(self.$items[pos])) {
self.$items[pos].addClass("OxSelected");
}
Ox.Event.trigger("select_" + self.options.id, {
that.triggerEvent("select", {
ids: $.map(self.selected, function(v, i) {
return self.ids[v];
})
@ -2487,6 +2489,7 @@ requires
function clear() {
$.each(self.requests, function(i, v) {
Ox.print("Ox.Request.cancel", v);
Ox.Request.cancel(v);
});
$.extend(self, {
@ -2524,7 +2527,7 @@ requires
if (!Ox.isUndefined(self.$items[pos])) {
self.$items[pos].removeClass("OxSelected");
}
Ox.Event.trigger("select_" + self.options.id, {
that.triggerEvent("select", {
ids: $.map(self.selected, function(v, i) {
return self.ids[v];
})
@ -2548,9 +2551,9 @@ requires
}
function getPage() {
return self.options.orientation == "vertical"
? Math.floor(that.scrollTop() / self.pageHeight)
: Math.floor(that.scrollLeft() / self.pageWidth);
return self.options.orientation == "horizontal"
? Math.floor(that.scrollLeft() / self.pageWidth)
: Math.floor(that.scrollTop() / self.pageHeight);
}
function getPositions() {
@ -2855,7 +2858,7 @@ requires
key: key,
operator: operator
}
// fixme: trigger sort event here
that.triggerEvent("sort", self.options.sort[0]);
updateSort();
}
}

View File

@ -3,8 +3,8 @@ $(function() {
var $body = $("body"),
$document = $(document),
app = new Ox.App({
requestURL: "http://blackbook.local:8000/api/"
// requestURL: "http://lion.oil21.org:8000/api/"
// requestURL: "http://blackbook.local:8000/api/"
requestURL: "http://lion.oil21.org:8000/api/"
}),
$menu = new Ox.MainMenu({
menus: [
@ -24,6 +24,9 @@ $(function() {
{ checked: false, group: "sort_movies", id: "director", title: "Director" },
{ checked: false, group: "sort_movies", id: "country", title: "Country" },
{ checked: true, group: "sort_movies", id: "year", title: "Year" },
{ checked: false, group: "sort_movies", id: "runtime", title: "Runtime" },
{ checked: false, group: "sort_movies", id: "language", title: "Language" },
{ checked: false, group: "sort_movies", id: "genre", title: "Genre" },
] },
{ id: "order_movies", title: "Order Movies", items: [
{ checked: false, group: "order_movies", id: "ascending", title: "Ascending"},
@ -72,7 +75,7 @@ $(function() {
title: v.title,
unique: true,
visible: true,
width: size - 50 - ($.browser.mozilla ? 16 : 12)
width: size - 60 - ($.browser.mozilla ? 16 : 12)
},
{
align: "right",
@ -80,7 +83,7 @@ $(function() {
operator: "-",
title: "Items",
visible: true,
width: 50
width: 60
}
],
id: "group_" + v.id,
@ -109,6 +112,7 @@ $(function() {
});
elements.push({
element: $group[i],
resizable: true,
size: size
});
});
@ -270,10 +274,9 @@ $(function() {
}).appendTo($body);
$.each(groups, function(i, group) {
Ox.Event.bind(null, "select_group_" + group.id, function(event, data) {
Ox.print("OK")
$list.options({
request: function(options) {
app.request("find", $.extend(options, {
return app.request("find", $.extend(options, {
query: {
conditions: $.map(data.ids, function(v, j) {
return {
@ -292,7 +295,7 @@ $(function() {
$group[i_].options({
request: function(options) {
delete options.keys;
app.request("find", $.extend(options, {
return app.request("find", $.extend(options, {
group: group_.id,
query: {
conditions: $.map(data.ids, function(v, j) {
@ -311,4 +314,10 @@ $(function() {
});
});
});
Ox.Event.bind(null, "change_sort_movies", function(event, data) {
});
Ox.Event.bind(null, "sort_list", function(event, data) {
});
});