Insert, update and remove for crud.
####Configuration
// miid of crud module
"crud": "crud",
// ui configuration
"ui": {
//focus the first textbox
"autofocus": "true/false" // (default: "false")
// the target of the form html
"target": ".form-container",
// the control handlers
"controls": {
"save": "button[name=save]",
"remove": "button[name=remove]",
"cancel": "button[name=cancel]"
},
"options": {
"dataChanged": "input/change" // (default: "change")
}
// TODO progress config
"progress": {}
},
#####Configuration options
dataChanged
: indicates when the module will emitdataChanged
event. It can take two values:change
(the default one) orinput
. Ifinput
is set, thedataChanged
event will be emited every time when the text from an input is changed (for example).
####Event interface
#####setTemplate
self.emit('setTemplate', {_id: 'templateId'});
#####setData
self.emit('setData', {_id: 'itemId'});
#####formRendered
self.on('formRendered', function () {});
#####dataSet
self.on('dataSet', function () {});
#####saved
self.on('saved', function () {});
#####removed
self.on('removed', function () {});
dataSet
event is emited also with the template ID of the item set. Therefore handlers can have the signature:function(data, templateId))
- transferred module to the new jxMono organization
- updated Bind to
v0.4.0
, Events tov0.4.0
- Broadcast save errors on update queries;
- Fixed small memory leak caused by click events that were not removed
- Updated to Bind
v0.3.1
- Do not disable fields that have a modm validation
- Added remove field functionality
- Added template parameter to
formRendered
event. - Do not ignore missing template fields from data. Letting the filters still do their job. Defaulting to empty string,
false
, or0
for fields not present in the data. - Added support for checkbox and radio button change events.
- Added isInsert boolean argument to
saved
event emit. - Emitting
fieldsRendered
immediately after attaching the template HTML. This allows for executing code before the DOM references are gathered (like preparing for i18n inputs). - Updated to Events
v0.3.0
and Bindv0.3.0
- Fixed default value for fields when min and max exist
- Updated to Events
v0.1.11
and Bindv0.2.2
- the
selected
option value in aSELECT
input will be considered when reseting a form
- Bind-form can now load more modules in the html of a template
- Fixed bug with forms not reacting at SELECT input changes
- Upgrade to Events v0.1.9
- Upgrade to Events v0.1.8 and Bind v0.2.1
- Added i18n template HTML support
- Added autofocus option
- Replaced
forEach
calls with for loops to be compatible with IE
config.options.dataChanged
can be any eventconfig.options.dataChanged
is anArray
or aString
- listen change event if other event is not provided
- When sending create CRUD requests, the CRUD document is unflattened
- Fixed displaying Array values in the value input in IE8
- Added bind dependency and support for
config.binds
- First versioned release