Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Prerequisite for building new

...

control.

...

3rd Party control files.

  • fullcalender.min.js
  • fullcalendar.css
  • alertify-1.0.6.js

Control level guidelines with examples.

  • A control should have one javascript file and one HTML template file with the same name. HTML template file should have plain HTML tags with knockout attributes
    example: html/BillingShippingAddress.html and js/BillingShippingAddress.js

  • A control's name should unique and meaningful and should not duplicate.
    example: BillingShippingAddress.html and BillingShippingAddress.js

  • A javascript variable will be created that will act as a collection for all of the controls objects. 
    example : var eb_billingShippingAddress = eb_billingShippingAddress || {};

  • Control's properties, functions and methods name should start with came case.
    example: productCatalogPage

  • Any object at the collection level should be generic to all instances of that control. Instance-specific information should live at the model level. SitePath, TemplatePath and ServicePath would be fixed properties for each control. These variables should be prefixed with an eb_prefix so that it does not collide with other JavaScript systems.
    example : 
    eb_billingShippingAddress.SitePath = eb_Config.SitePath;
    eb_billingShippingAddress.TemplatePath = "html/BillingShippingAddress.html";
    eb_billingShippingAddress.ServicePath = eb_Config.ServicePath;

  • The Path of the HTML template should mirror that of the path to the JS.
    example: eb_billingShippingAddress.TemplatePath = "html/BillingShippingAddress.html";

  • Each model's properties / field should be defined camel case and assign to ko.observable / ko.observableArray / ko.computed based on logic. 
    example: 
       var _that = this;
     _that.domElement = options.domElement;

    _that.showError = ko.observable(0);
    _that.errorMessage = ko.observable();
    _that.showSuccess = ko.observable(0);
    _that.successMessage = ko.observable();
    _that.billingAddress = ko.observableArray();

  • Should not use 'this' object directly in function. It should use var _self = this;

...