Search code examples
twitter-bootstrapmeteortwitter-bootstrap-3uniformmeteor-autoform

Meteor -> aldeed->Auto-form How to customize checkbox


I have following schema for checkbox:

'category.isParent': {
    type: Boolean
   ,defaultValue: false
}

Following is auto-form code for checkbox:

    <div class="row">
        <div class="col-lg-8 col-md-offset-5 padding-left-0">
          {{> afFieldInput  name='category.isParent' id='isParent' template="plain"}}
        </div>
   </div>

Following is generated source code (copied from firefox )

<div class="checkbox">
<label>
  <div id="uniform-isParent" class="checker"><span><input data-schema-key="category.isParent" id="isParent" name="category.isParent" type="checkbox"></span></div>
  Is parent
</label>

I want to customize this generated source code as per my desire. Can some one guide me, what and how can I do so in auto-form or in simple schema to customize the auto-form automatically generated code.


Solution

  • You can do some customization with autoform by setting field default attributes.

    See: https://github.com/aldeed/meteor-autoform#putting-field-attribute-defaults-in-the-schema