Hi,
I try from “jet-start-typescript” to dynamically load data into a dadatable.
the data is well loaded (xhr is ok on debug view)
but nothing is displayed in the grid
export default class DataView extends JetView{
config(){
return {
view:"datatable",
columns:[
{ id:"id", header:"", css:"rank", width:50},
{ id:"title", header:"Film title", width:200},
{ id:"year", header:"Released", width:80},
{ id:"votes", header:"Votes", width:100},
{ id:"rating", header:"Rating", width:100},
{ id:"rank", header:"rank", width:100}
],
url:"data/data.json",
datatype:"json"
};
}
}
the data / data.json url is a java servlet that returns
{"data":[
[1, "The Shawshank Redemption", 1994, 678790, 9.2, 1],
[2, "The Godfather", 1972, 511495, 9.2, 2],
[3, "The Godfather: Part II", 1974, 319352, 9.0, 3],
[4, "The Good, the Bad and the Ugly", 1966, 213030, 8.9, 4],
[5, "My Fair Lady", 1964, 533848, 8.9, 5],
[6, "12 Angry Men", 1957, 164558, 8.9, 6]
],
pos:0
total_count:6
}
I've tried
[
[1, "The Shawshank Redemption", 1994, 678790, 9.2, 1],
[2, "The Godfather", 1972, 511495, 9.2, 2],
[3, "The Godfather: Part II", 1974, 319352, 9.0, 3],
[4, "The Good, the Bad and the Ugly", 1966, 213030, 8.9, 4],
[5, "My Fair Lady", 1964, 533848, 8.9, 5],
[6, "12 Angry Men", 1957, 164558, 8.9, 6]
]
or
[
{
id:1, title:"The Shawshank Redemption",
year:1994, votes:678790, rating:9.2, rank:1},
{
id:2, title:"The Godfather",
year:1972, votes:511495, rating:9.2, rank:2},
{
id:3, title:"The Godfather: Part II",
year:1974, votes:319352, rating:9.0, rank:3},
{
id:4, title:"The Good, the Bad and the Ugly",
year:1966, votes:213030, rating:8.9, rank:4},
{
id:5, title:"My Fair Lady",
year:1964, votes:533848, rating:8.9, rank:5},
{
id:6, title:"12 Angry Men",
year:1957, votes:164558, rating:8.9, rank:6}
]
or
{"data":[
{
id:1, title:"The Shawshank Redemption",
year:1994, votes:678790, rating:9.2, rank:1},
{
id:2, title:"The Godfather",
year:1972, votes:511495, rating:9.2, rank:2},
{
id:3, title:"The Godfather: Part II",
year:1974, votes:319352, rating:9.0, rank:3},
{
id:4, title:"The Good, the Bad and the Ugly",
year:1966, votes:213030, rating:8.9, rank:4},
{
id:5, title:"My Fair Lady",
year:1964, votes:533848, rating:8.9, rank:5},
{
id:6, title:"12 Angry Men",
year:1957, votes:164558, rating:8.9, rank:6}
],
pos:0
total_count:6
}
but nothing ever appears
the ultimate goal is to be able to load the data in real time using a websocket.
But before, I wish I could just load the data once;
спасибо
JYT