项目作者: tomi77

项目描述 :
Backbone-Forms jQuery UI editors
高级语言: CoffeeScript
项目地址: git://github.com/tomi77/backbone-forms-jquery-ui.git
创建时间: 2016-07-22T10:49:15Z
项目社区:https://github.com/tomi77/backbone-forms-jquery-ui

开源协议:MIT License

下载


Backbone-Forms jQuery UI editors

Build Status
Code Climate
dependencies Status
devDependencies Status
Downloads

A Backbone-Forms jQuery UI related editors

Table of contents

Installation

Bower:

  1. bower install backbone-forms-jquery-ui

NPM:

  1. npm install backbone backbone-forms backbone-forms-jquery-ui

jQuery UI editors

autocomplete

Schema options

options - Array of strings or Backbone Collection

editorOptions - jQuery UI autocomplete options

Example

  1. var states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California',
  2. 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii',
  3. 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana',
  4. 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota',
  5. 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire',
  6. 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota',
  7. 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island',
  8. 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont',
  9. 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'
  10. ];
  11. var form = new Backbone.Form({
  12. schema: {
  13. state: {
  14. type: 'jqueryui.autocomplete',
  15. title: 'State',
  16. options: states,
  17. editorOptions: {
  18. minLength: 2
  19. }
  20. }
  21. }
  22. });

Demo

checkbox

Schema options

editorOptions - jQuery UI checkboxradio options

Example

  1. var form = new Backbone.Form({
  2. schema: {
  3. val: {
  4. type: 'jqueryui.checkbox',
  5. title: 'Val'
  6. }
  7. }
  8. });

Demo

checkboxes

Schema options

editorOptions - jQuery UI checkboxradio options

Example

  1. var form = new Backbone.Form({
  2. schema: {
  3. val: {
  4. type: 'jqueryui.checkboxes',
  5. title: 'Val',
  6. options: ['1', '2', '3']
  7. }
  8. }
  9. });

Demo

datepicker

Schema options

editorOptions - jQuery UI datepicker options

Example

  1. var form = new Backbone.Form({
  2. schema: {
  3. date: {
  4. type: 'jqueryui.datepicker',
  5. title: 'Date',
  6. editorOptions: {
  7. numberOfMonths: [2, 3]
  8. }
  9. }
  10. }
  11. });

Demo

radio

Schema options

editorOptions - jQuery UI checkboxradio options

Example

  1. var form = new Backbone.Form({
  2. schema: {
  3. val: {
  4. type: 'jqueryui.radio',
  5. title: 'Val',
  6. options: ['1', '2', '3']
  7. }
  8. }
  9. });

Demo

selectmenu

Schema options

options - Array of strings or Backbone Collection

editorOptions - jQuery UI selectmenu options

Example

  1. var form = new Backbone.Form({
  2. schema: {
  3. speed: {
  4. type: 'jqueryui.selectmenu',
  5. title: 'Speed',
  6. options: ['Slower', 'Slow', 'Medium', 'Fast', 'Faster']
  7. }
  8. }
  9. });

Demo

slider

Schema options

editorOptions - jQuery UI slider options

Example

  1. var form = new Backbone.Form({
  2. schema: {
  3. val: {
  4. type: 'jqueryui.slide',
  5. title: 'Val'
  6. }
  7. }
  8. });

Demo

spinner

Schema options

editorOptions - jQuery UI spinner options

Example

  1. var form = new Backbone.Form({
  2. schema: {
  3. val: {
  4. type: 'jqueryui.spinner',
  5. title: 'Val',
  6. editorOptions: {
  7. min: 0,
  8. max: 100,
  9. page: 10
  10. }
  11. }
  12. }
  13. });

Demo