Using Backbone and jQuery take item.json
and render a form similar to the form illustrated in 1stdibs_fe_quiz.jpg
.
Certain fields ("materials" dropdown, radio button groups) require enumerations that can be found in the enums.json
file.
This file is a very simplified version of the 1stdibs item model. An item is simply a thing that is available for sale on 1stdibs.com.
1stdibs.com private internal APIs return models wrapped in a common wrapper with the model residing in the result
property.
No validation is required for this quiz. There is one state condition that is required. The condition is that part of the form be disabled until the user selects an option in another field. See 1stdibs_fe_quiz.jpg
for the details.
Feel free to use Twitter Bootstrap to match the style in the jpeg example.
-
item.json
must be loaded via AJAX (asynchronous of the page load; you'll want to have a development web server running).enums.json
isn't required to be loaded asynchronously, it may be "bootstrapped" on page load. -
The form must be built dynamically by combining the values in the item model with enumerations in the enums.json file. Other form elements (labels, etc) may be hard-coded into HTML and/or templates.
-
The user should be able to update and edit all form fields.
-
Pressing the Save button should dump an updated and/or edited item.json to the browser console to demonstrate that it could be persisted to the server.
-
As mentioned earlier, there is a state condition that must be handled. See
1stdibs_fe_quiz.jpg
for the details.
-
The purpose of the quiz is to demonstrate your understanding of key Backbone concepts: models, views and templates. One other key concept, routers, aren't encompassed in this quiz.
-
Stay away from one monolithic view/template.
-
Out-of-the-box, Backbone doesn't handle nested models.
- Backbone - Backbone documentation
- Underscore - Underscore documentation (many Underscore methods are mixed into Backbone collections)
- Backbone Fundamentals - A book on Backbone.js for beginners and advanced users alike
- JavaScript Design Patterns - A free ebook discussing general JavaScript design patterns