January 2016
Intermediate to advanced
278 pages
4h 53m
English
A common issue when rendering views is not rendering plugins from others because they are designed to work with traditional web applications but not with SPA; this is because many plugins are DOM-dependent, which means that the target element should exist in the actual DOM. To see this issue more clearly, let me show you an example with the jQueryUI Calendar plugin. Let's add a birthdate field to our ContactEditor, replacing the age field.
// index.html
// ...
<div class="form-group">
<label for="birthdate">Birth date</label>
<input id="birthdate " type="text"
class="form-control" value="<%= birthdate %>" />
//...And make the proper changes in the view:
class ContactForm extends ModelView { // ... serializeData() { ...Read now
Unlock full access