How to use the bootstrap.ListObject function in bootstrap

To help you get started, we’ve selected a few bootstrap 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 powmedia / backbone-forms / src / editors / bootstrap.js View on Github external
renderSummary: function() {
      var template = Form.templates['bootstrap.ListObject'];

      this.$el.html(template({
        summary: this.getStringValue()
      }));
    },
github powmedia / backbone-forms / src / editors / bootstrap.js View on Github external
var Form = Backbone.Form,
      editors = Form.editors;

  Form.setTemplates({
    'bootstrap.ListObject': '\
      <div style="cursor: pointer; border: 1px solid #ccc; width: 208px; border-radius: 3px; padding: 4px; color: #555">\
        {{summary}}\
      </div>\
    '
  });

  /**
   * Modal object editor for use with the List editor.
   * To use it, set the 'itemType' property in a List schema to 'bootstrap.ListObject'
   */
  editors['bootstrap.ListObject'] = editors['bootstrap.ListNestedModel'] = editors.Base.extend({
    events: {
      'click': 'openEditor'
    },

    /**
     * @param {Object} options
     * @param {String} [options.schema.itemType]    Item editor type: 'List.Object' | 'List.NestedModel'
     * @param {Object} [options.schema.subSchema]   Schema for nested form,. Required when itemType is 'Object'
     * @param {Function} [options.schema.model]     Model constructor function. Required when itemType is 'NestedModel'
     */
    initialize: function(options) {
      editors.Base.prototype.initialize.call(this, options);
      
      //Dependencies
      if (!Backbone.BootstrapModal) throw new Error('Backbone.BootstrapModal is required');