Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The big thing you need to do is make the workflow separate from the views themselves. That is, you should have an object that coordinates the work flow between the views, holds on to the data that was entered in to the views, and uses the results of the views (through events or other means) to figure out where to go next.</p> <p>I've blogged about this in more detail, with a very simple example of a wizard-style interface, here:</p> <p><a href="http://lostechies.com/derickbailey/2012/05/10/modeling-explicit-workflow-with-code-in-javascript-and-backbone-apps/">http://lostechies.com/derickbailey/2012/05/10/modeling-explicit-workflow-with-code-in-javascript-and-backbone-apps/</a></p> <p>and here:</p> <p><a href="http://lostechies.com/derickbailey/2012/05/15/workflow-in-backbone-apps-triggering-view-events-from-dom-events/">http://lostechies.com/derickbailey/2012/05/15/workflow-in-backbone-apps-triggering-view-events-from-dom-events/</a></p> <p>Here's the basic code from that first post, which shows the workflow object and how it coordinates the views:</p> <pre><code> orgChart = { addNewEmployee: function(){ var that = this; var employeeDetail = this.getEmployeeDetail(); employeeDetail.on("complete", function(employee){ var managerSelector = that.selectManager(employee); managerSelector.on("save", function(employee){ employee.save(); }); }); }, getEmployeeDetail: function(){ var form = new EmployeeDetailForm(); form.render(); $("#wizard").html(form.el); return form; }, selectManager: function(employee){ var form = new SelectManagerForm({ model: employee }); form.render(); $("#wizard").html(form.el); return form; } } // implementation details for EmployeeDetailForm go here // implementation details for SelectManagerForm go here // implementation details for Employee model go here </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload