- πΊπΈUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051
I have created an article view that contains different displays and I am following the simplified instructions on the module home page to get the view.
var viewCollection = new Drupal.Backbone.Collections.NodeView();
viewCollection.viewName = 'articles';
viewCollection.fetch({
success: function (jsonView) {
var result = $("#backbone-view-container");
result.html(JSON.stringify(jsonView));
}
});
this is returning the following array of objects with an invalid node id.
[
{
"node":{
"node_title":"my node title",
"nid":"\"\""
}
}
]
i was not expecting a meaningful result using the above js because i havent defined a display_id to fully qualify my view. i.e. the viewname articles can refer to one or more actual views... this is best illustrated comparing the API to the core Drupal API for embedding a view
views_embed_view($name, $display_id = 'default')
I was kind of expecting to need to define a Service View (to return the json i want) and then specify it through the API to get the exact data I want.
Please can you advise further on the correct way of setting up backbone to use with views.
Thanks
Laurence
Closed: duplicate
1.0
JS Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.