oxjs/demos/test/list.js

72 lines
2.1 KiB
JavaScript
Raw Normal View History

2010-06-25 15:55:25 +00:00
$(function() {
Ox.theme("modern");
var $body = $("body"),
app = new Ox.App({
2010-06-28 09:16:36 +00:00
requestURL: "http://lion.oil21.org:8000/api/"
2010-06-25 15:55:25 +00:00
}),
$list = new Ox.TextList({
columns: [
{
align: "left",
id: "title",
operator: "+",
title: "Title",
2010-06-28 09:16:36 +00:00
visible: true,
2010-06-25 15:55:25 +00:00
width: 160
},
{
align: "left",
id: "director",
operator: "+",
title: "Director",
2010-06-28 09:16:36 +00:00
visible: true,
2010-06-25 15:55:25 +00:00
width: 160
},
2010-06-28 09:16:36 +00:00
{
align: "left",
id: "country",
operator: "+",
title: "Country",
visible: true,
width: 120
},
2010-06-25 15:55:25 +00:00
{
align: "right",
id: "year",
operator: "-",
title: "Year",
2010-06-28 09:16:36 +00:00
visible: true,
width: 80
},
{
align: "right",
id: "runtime",
operator: "-",
title: "Runtime",
visible: false,
2010-06-25 15:55:25 +00:00
width: 80
}
],
request: function(options) {
app.request("find", $.extend(options, {
query: {
conditions: [
{
key: "country",
value: "france",
operator: ""
}
],
operator: ""
}
}), options.callback);
},
2010-06-28 09:16:36 +00:00
sort: [
{
key: "year",
operator: "-"
}
]
2010-06-25 15:55:25 +00:00
}).appendTo($body);
});