M
M
Mike Gasper2015-11-04 14:50:18
backbone.js
Mike Gasper, 2015-11-04 14:50:18

Where is the problem when displaying the model?

Good day to all,
I'm learning Marionette.js and doing a project for the university.
But there was a problem! I created an instance of the view and passed the model there, but the data from the model is not displayed when the page is rendered.
If I create the model myself through var model = new Backbone.Model() and manually pass the parameters I need there, then everything works.
PS var formular = Application.request("formular:get:by:id", id) ; - obtaining model with all data.
In the console, the model is filled and all the data is in place, but it is still not displayed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Idel Gizatullin, 2015-11-04
@idelg

It's hard to understand the problem without code.
I advise you to study Marionette on a ready-made example , look at the source code and do everything the same way.
I usually start a project by deploying this repository. This is such a handy backbone skeleton.

A
Alexander Lebedev, 2015-11-04
@zymanch

If you get the data for the model from the server (rather than loading, say, from fixtures directly in the code), then it is very likely that at the moment your view's render is called, the model is not yet ready,
try making the view wait for the model's sync event,
but in general, look at the code...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question