How to use the dojo/_base/lang.setObject function in dojo

To help you get started, we’ve selected a few dojo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Saleslogix / argos-saleslogix / src / Views / Charts / _ChartMixin.js View on Github external
/**
 * @module crm/Views/Charts/_ChartMixin
 */
import declare from 'dojo/_base/declare';
import lang from 'dojo/_base/lang';
import connect from 'dojo/_base/connect';
import domGeo from 'dojo/dom-geometry';
import domAttr from 'dojo/dom-attr';
import has from 'dojo/has';
import _PullToRefreshMixin from 'argos/_PullToRefreshMixin';
import Utility from 'argos/Utility';
import getResource from 'argos/I18n';

const resource = getResource('chartMixin');

lang.setObject('Chart.defaults.global', {
  // Boolean - Whether to animate the chart
  animation: false,

  // Number - Number of animation steps
  animationSteps: 60,

  // String - Animation easing effect
  animationEasing: 'easeOutQuart',

  // Boolean - If we should show the scale at all
  showScale: true,

  // Boolean - If we want to override with a hard coded scale
  scaleOverride: false,

  // ** Required if scaleOverride is true **
github Saleslogix / argos-saleslogix / src / Integrations / BOE / Modules / PayFromModule.js View on Github external
import declare from 'dojo/_base/declare';
import lang from 'dojo/_base/lang';
import _Module from './_Module';

const __class = declare('crm.Integrations.BOE.Modules.PayFromModule', [_Module], {
  init: function init() {
  },
  loadViews: function loadViews() {
  },
  loadCustomizations: function loadCustomizations() {
  },
  loadToolbars: function loadToolbars() {
  },
});

lang.setObject('icboe.Modules.PayFromModule', __class);
export default __class;
github Saleslogix / argos-saleslogix / src / Integrations / BOE / Views / Quotes / List.js View on Github external
}]);
  },
  formatSearchQuery: function formatSearchQuery(searchQuery) {
    const q = this.escapeSearchQuery(searchQuery.toUpperCase());
    return `upper(QuoteNumber) like "${q}%" or Account.AccountName like "${q}%" or ErpExtId like "${q}%"`;
  },
  formatErpStatus: function formatErpStatus(value) {
    const text = App.picklistService.getPicklistItemTextByCode('ErpQuoteStatus', value);
    if (text) {
      return text;
    }
    return value;
  },
});

lang.setObject('icboe.Views.Quotes.List', __class);
export default __class;
github Saleslogix / argos-saleslogix / src / Integrations / BOE / Modules / SalesOrderItemModule.js View on Github external
id: 'orderline_pricingAvailabilityLocations',
      entityType: 'SalesOrderItem',
      requestType: 'SalesOrderItemAvailable',
      parentEntity: 'SalesOrder',
      singleSelectAction: 'complete',
    }));

    am.registerView(new SlxLocationList());
  },
  loadCustomizations: function loadCustomizations() {
  },
  loadToolbars: function loadToolbars() {
  },
});

lang.setObject('icboe.Modules.SalesOrderItemModule', __class);
export default __class;
github Saleslogix / argos-saleslogix / src / Aggregate.js View on Github external
* See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @module crm/Aggregate
 */
import lang from 'dojo/_base/lang';

/**
 * @class
 * @alias module:crm/Aggregate
 * @classdesc Aggregate functions. Currently used in metric widgets.
 * @static
 */
const __class = lang.setObject('crm.Aggregate', /** @lends module:crm/Aggregate */{
  /**
   * Average
   * @param {Array} data Array of objects that contain a value property
   * @return {Number}
   */
  avg: function avg(data) {
    const aggr = window.crm.Aggregate;
    const average = aggr.sum(data) / aggr.count(data);
    return isNaN(average) ? 0 : average;
  },
  /**
   * Count
   * @param {Array} data Array of objects that contain a value property
   * @return {Number}
   */
  count: function count(data) {
github Saleslogix / argos-saleslogix / src / Integrations / BOE / Models / ErpReceivable / Base.js View on Github external
type: 'ManyToOne',
      parentProperty: 'ErpShipTo',
      parentPropertyType: 'object',
      relatedEntity: 'ERPShipTo',
    }, {
      name: 'ReceivableItem',
      displayName: receivableItemResource.entityDisplayName,
      type: 'OneToMany',
      relatedEntity: 'ERPReceivableItem',
      relatedProperty: 'ErpReceivable',
      relatedPropertyType: 'object',
    }]);
    return rel;
  },
});
lang.setObject('icboe.Models.ErpReceivable.Base', __class);
export default __class;
github Saleslogix / argos-saleslogix / src / Integrations / BOE / Modules / SalesOrderModule.js View on Github external
return tool.id === 'new';
      },
      type: 'remove',
    });

    am.registerCustomization('list/tools', 'salesorder_shipment_items_related', {
      at: function at(tool) {
        return tool.id === 'new';
      },
      type: 'remove',
    });
  },
  loadToolbars: function loadToolbars() {
  },
});
lang.setObject('icboe.Modules.SalesOrderModule', __class);
export default __class;
github Saleslogix / argos-saleslogix / src / Integrations / BOE / Views / QuoteLines / List.js View on Github external
}
  },
  getAvailabilityView: function getAvailabilityView() {
    const viewId = 'locations_quoteItemAvailabilityList';
    let view = App.getView(viewId);
    if (view) {
      return view;
    }

    App.registerView(new QuoteItemAvailabilityList({ id: viewId }));
    view = App.getView(viewId);
    return view;
  },
});

lang.setObject('icboe.Views.QuoteLines.List', __class);
export default __class;
github Saleslogix / argos-saleslogix / src / Integrations / BOE / Models / ErpShipTo / Base.js View on Github external
type: 'ManyToOne',
        relatedEntity: 'Return',
        relatedProperty: 'ErpShipTo',
        relatedPropertyType: 'object',
      }, {
        name: 'SyncHistory',
        displayName: syncresultResource.entityDisplayName,
        type: 'OneToMany',
        relatedEntity: 'SyncResult',
        relatedProperty: 'EntityId',
        where: 'EntityType eq "ERPShipTo"',
      }]);
    return rel;
  },
});
lang.setObject('icboe.Models.ErpShipTo.Base', __class);
export default __class;
github Saleslogix / argos-saleslogix / src / Integrations / BOE / ApplicationModule.js View on Github external
registerDefaultViews: function registerDefaultViews() {
    const self = this;
    const originalGetDefaultViews = Application.prototype.getDefaultViews;
    lang.extend(Application, {
      getDefaultViews: function getDefaultViews() {
        const views = originalGetDefaultViews.apply(this, arguments) || [];
        self.modules.forEach((module) => {
          module.registerDefaultViews(views);
        });
        return views;
      },
    });
  },
});

lang.setObject('icboe.ApplicationModule', __class);
export default __class;

dojo

Dojo core is a powerful, lightweight library that makes common tasks quicker and easier. Animate elements, manipulate the DOM, and query with easy CSS syntax, all without sacrificing performance.

BSD-3-Clause OR AFL-2.1
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis