oxjstmp/demos/test/list.js

72 lines
2.1 KiB
JavaScript

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