[ckan-dev] Recline.JS problems

Daniel Lombraña González teleyinex at gmail.com
Tue Jul 24 10:07:10 UTC 2012


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

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!!!

Regards,

Daniel


-- 
··························································································································································
http://github.com/teleyinex
http://www.flickr.com/photos/teleyinex
··························································································································································
Por favor, NO utilice formatos de archivo propietarios para el
intercambio de documentos, como DOC y XLS, sino PDF, HTML, RTF, TXT, CSV
o cualquier otro que no obligue a utilizar un programa de un
fabricante concreto para tratar la información contenida en él.
··························································································································································
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120724/2418d2a1/attachment.html>


More information about the ckan-dev mailing list