

In the first part we will develop a webwork with a soy template. We will use the out of the box Jira plugin UI libraries: soy, requirejs and backbone js. These plugin settings will be stored by a webwork. If you need to make changes to the Backbone.js framework, you may need to modify the files in this directory.In this article we will develop a plugin, which will store plugin settings. Modules/suitecommerce/BackboneExtras: contains extensions of core Backbone.js functionality, including Backbone.View and Backbone.Model. In general, you should not modify the files in this directory. Modules/third_parties/backbone.js: contains the core Backbone.js libraries. SCA stores Backbone.js files in the following directories: However, much of the specific functionality of the application must be implemented. The Backbone.js libraries provide a general framework for how a web application is structured and its general functionality.

When the router initializes, it passes the instance of Case.Model. Case.Model extends the Backbone.Model by defining additional methods for performing frontend validation.

Initializes the view that displays the data ()Ĭase.Model defines the data object that contains information about an individual support case. Initializes the model that contains data for a specific support case (Case.Model). When a user clicks on an individual case from the list of support cases, instead of sending an HTTP request back to the server, the router calls the showCaseList method based on the value of the partial URL (cases). They also define the methods that create, update, or delete data.įor example, the Case module defines a router () that contains the following: routes: Models and Collections: define objects that contain data used by the application. The templating engine handles the rendering and updating of the HTML.
Backbone js plugins code#
Instead, they specify the template that defines the HTML code for the component or feature. Views do not define the HTML or CSS of a feature or component. With the Elbrus release of SCA and later, all views are composite views by default and extend. These listeners enable a specific part of the application to be updated independently without having to reload the page. Most views define listeners that notify the view when an element within the model is modified. When a view is initialized, its corresponding model is usually passed, ensuring that the view has access to the data within the model. Views are commonly associated with a model or collection. Views: contain methods that define the behavior of the user interface. In feature modules, these methods initialize the views, models, and collections that handle the user interface and create frontend objects to handle data.Įach router contains a routes object that defines the mapping between URLs and methods. Routers: map URLs to client-side pages to methods that define actions and events. The Case module, for example, implements each of these: Modules that define interfaces or handle data use Backbone.js to define routers, views, and models/collections. Structure of a Backbone.js Applicationīackbone.js is based on the MVC pattern. Backbone.js is an open-source JavaScript library that provides a framework for developing web applications. To implement the MVC pattern, SuiteCommerce Advanced (SCA) uses the Backbone.js libraries. All interaction between views and models are handled by the controller. One of the core principles of the MVC pattern is to separate the presentation layer (view) of an application from the data (model) used by the application. Source files of each module follow the Model View Controller (MVC) architectural pattern.
