[ckan-dev] Recline.JS problems

Rufus Pollock rufus.pollock at okfn.org
Tue Jul 24 10:18:25 UTC 2012


On 24 July 2012 11:07, Daniel Lombraña González <teleyinex at gmail.com> wrote:
> Dear all,
>
> I'm trying to use Recline.JS for displaying some data and learning something
> new, but when I'm following the tutorial I've found some issues:
>
> * Creating the dataset with the following code gives some errors:
>
>
> var dataset = new recline.Model.Dataset({
>   records: data
> });
>
>
> So I've tried with this other approach from the source code:
>
>                     var fields = [
>                         {id: 'id'},
>                         {id: 'user_name'},
>                         {id: 'date', type:'date'}
>                         ];
>
>                     var dataset =
> recline.Backend.Memory.createDataset(data,fields);
>
> This one works. After that, I continued with the tutorial, and I found that:
>
> * dataset.recordCount returns undefined and I do not know why.
> * the same for dataset.records.length, however if you try
> dataset.attributes.records it works

Have you called dataset.fetch();

> I've tried it with my own code and dataset, and with the examples that are
> provided in the Github repository, but in all the cases I get the same
> "undefined" output. Interestingly, the Grid view works and renders well
> (actually, the first row does not show the right colors, but that's
> something about the CSS and I'm not too worried right now).
>
> Then, after rendering the Grid, I wanted to try with the Timeline. I
> followed the same approach as with the Grid:
>
>                     var timeline = new recline.View.Timeline({
>                         model: dataset,
>                         el: $el
>                             });
>                     grid.visible = true;
>                     grid.render();
>
>
> where $el is a div in the HTML page, and the dataset has the following
> fields:
>
> [{id, user_name, date}]
>
> While the Grid works well, the Timeline does not show anything, and I do not
> get any console error, so I do not know where is the problem. Can you help
> me and let me know what I'm doing wrong? Thanks in advance!!!

Can you post your full code somewhere?

Rufus




More information about the ckan-dev mailing list