jQuery Plugin for Data Binding
Chain Update Service
Automatically generated from update.js
Also known as jQuery.Chain.services.update.bind
If you pass a function to update, it will bind it to the update event. just like jQuerys click()
or mouseover()
.
see jQuery.Chain.services.update.handler
Automatically generated from update.js
// assuming #person is already chained $('#person').update(function{ alert($(this).item().name); }); $('#person').item({name: 'Rizqi'})
Also known as jQuery.Chain.services.update.trigger
If no argument or "hard" is passed, it will update the element and trigger the update event.
see jQuery.Chain.services.update.handler
Automatically generated from update.js
$('#person').update();
Chain Binding Service. Method to activate the chaining / element rendering service.
Automatically generated from chain.js
Also known as jQuery.Chain.services.chain.handleUpdater
Updater Handler. If you pass an object to chain
, it will treated as a updater object. The updater is a hash of selector and value string: like chain({'my css selector': 'My Content String'})
or chain({'my css selector': {attributes}})
Automatically generated from chain.js
$(selector) .chain({ // Items anchor, where the Item iteration should be placed anchor: anchor, // If true, the default updater is overridden override: false, // Use custom builder builder: function(){}, // Update the element self self: "This is my {data}", // Use css selector to update child element '.element.selector': "Using String Updater", // Use Function as updater '.element.selector': function(data, el){}, // Updating Attributes '.element.selector': { attribute1: "{attribute}", className: "{className}", content: "This is the {content}", value: "This is the {value}" } });
$('<div><span class="name">Name</span></div>') .item({name: 'Steve Jobs'}) .chain() .appendTo(document.body);
$('<div><div class="name"><span class="first">First</span> <span class="last">Last</span></div></div>') .item({first:'Steve', last:'Jobs'}) .chain({ '.name .first': { style: 'color: blue;', content: 'First Name: {first}' }, '.name .last': 'Family Name: {last}' }) .appendTo(document.body);
$('<div><div class="name">Name</div><div class="address">Address</div></div>') .item({name:'Steve Jobs', address:'Cupertino'}) .chain({ builder: function(){ var data = this.item(); this.find('.name').click(function(){alert(data.name)}); this.find('.address').mouseout(function(){alert(data.address)}); }, '.name': '{name}', '.address': '{address}' }) .appendTo(document.body);
Also known as jQuery.Chain.services.chain.handleBuilder
Builder Handler. If you pass a function to chain
, it will be handled as {builder: function}
, enabling you to use the default updater while customizing the events etc.
see jQuery.Chain.services.chain.handleUpdater
Automatically generated from chain.js
$('<div><div class="name">Name</div><div class="address">Address</div></div>') .item({name:'Steve Jobs', address:'Cupertino'}) .chain(function(){ this.bind('click', function(){ var data = this.item(); alert('name:'+data.name+', address:'+data.address); }); // if you return false, default builder wont be executed // You don't have to return true; return true; }) .appendTo(document.body);
Also known as jQuery.Chain.services.chain.$anchor
Set new Anchor and rerender if new anchor passed. Otherwise return current anchor. If you use items()
with chain()
, you can use chain('anchor', selector)
to move the element, where the items will be generated.
Automatically generated from chain.js
$('#persons').chain('anchor', '.wrapper'); // Define Anchor directly while building $('#persons').items([...]).chain({anchor:'.wrapper', builder: ...});
Also known as jQuery.Chain.services.chain.$template
Getting/Switching Template.
Automatically generated from chain.js
$(selector).chain('template') // Returns current Template (jQuery Object) $(selector).chain('template', 'raw') // Returns raw HTML Templates (all) $(selector).chain('template', nr) // Switch to template nr (read: Number) $(selector).chain('template', '.tree-column') // Switch by selector
Also known as jQuery.Chain.services.chain.$builder
Get/Change Builder. If you don't pass any argument, it will return the created builder.
Automatically generated from chain.js
$('#el').chain('builder') // returns builder function $('#el').chain('builder', newBuilder) // Replace Builder
Also known as jQuery.Chain.services.chain.$active
Check status
Automatically generated from chain.js
Also known as jQuery.Chain.services.chain.$plugin
Add/Remove Plugins that extend builder
Automatically generated from chain.js
Also known as jQuery.Chain.services.chain.$clone
Clone Element unchained, with ID removed.
Automatically generated from chain.js
Also known as jQuery.Chain.services.chain.$destroy
Destroy Chain, restore Element to previous condition.
Automatically generated from chain.js
Chain Item Service. Method to bind item to object.
Automatically generated from item.js
Also known as jQuery.Chain.services.item.handleObject
Edit/Bind Item. If no Object defined, it will bind the object to the Item, otherwise it will alter the object using the provided object.
see jQuery.Chain.services.item.handler
Automatically generated from item.js
$('#element').item({name:'Rizqi', country:'Germany'}); $('#element').item({country:'Indonesia'}); $('#element').item(); // Returns {name:'Rizqi', country:'Indonesia'}
Also known as jQuery.Chain.services.item.handleFunction
Add setter and getter to item. This function will change the way item(object)
and item()
works.
Automatically generated from item.js
$(element).item(function(oldval, newval){ //setter if(newval) return $.extend(oldval, newval); //getter else return oldval; })
Also known as jQuery.Chain.services.item.handleDefault
Get Data if no argument passed.
Automatically generated from item.js
Also known as jQuery.Chain.services.item.$update
Item Updater, called within $(element).update()
Automatically generated from item.js
Also known as jQuery.Chain.services.item.$replace
Replace Data with new data
Automatically generated from item.js
$(element).item('replace', data);
Also known as jQuery.Chain.services.item.$remove
Remove Item And destroy it.
Automatically generated from item.js
Also known as jQuery.Chain.services.item.$active
Check Status of item
Automatically generated from item.js
Also known as jQuery.Chain.services.item.$backup
Backup Item to the state before being built.
Automatically generated from item.js
Also known as jQuery.Chain.services.item.$link
Bind Item to other (chained) element. If one of them is updated, the linked element will be updated.
"self"
if linked to item)
see jQuery.Chain.services.items.collection
Automatically generated from item.js
Also known as jQuery.Chain.services.item.$destroy
Destroy item service.
Automatically generated from item.js
Chain Items Service. Method to bind items to object.
Automatically generated from items.js
Also known as jQuery.Chain.services.items.handleObject
If a Data Object is given, it will return the item element containing the object if it exists, otherwise empty.
Automatically generated from items.js
Also known as jQuery.Chain.services.items.handleElement
If a jQuery Element is given, it will return itself if it is part of the items, otherwise empty jQuery object.
Automatically generated from items.js
Also known as jQuery.Chain.services.items.handleArray
If array is given, it will merge it to current items
Automatically generated from items.js
Also known as jQuery.Chain.services.items.handleNumber
If number is given, it will get the object with the current number. Use -1 to get the last number.
Automatically generated from items.js
Also known as jQuery.Chain.services.items.handleTrue
If true
is given, it will get all items including the hidden one.
see jQuery.Chain.services.items.collections.all
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$update
Items Updater, called by $(element).update()
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$add
Add item(s). use items('add', 'shift', item)
to add item at the top
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$merge
Merge items with array of item data
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$replace
Replace items with new items array
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$remove
Remove item
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$reorder
Reorder Item
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$empty
Clear all items
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$data
Like items()
but returns array of data instead of the jQuery object.
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$link
Bind Items to other (chained) element. If one of them is updated, the linked element will be updated.
"self"
if linked to item)
see jQuery.Chain.services.items.collection
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$index
Get index of an Item
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$collection
Get collection of items. Define a collection by adding a function argument
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$active
Check Status of items
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$backup
Backup Item to the state before being built.
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$destroy
Destroy items service.
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$filter
Filter items by criteria. Filtered items will be hidden.
Automatically generated from items.js
Also known as jQuery.Chain.services.items.$sort
Sort items by property.
Automatically generated from items.js
Tag for use in jQuery.Chain.parse
(which is used in CustomUpdater). It is can be altered.
Automatically generated from core.js
Namespace containing all defined services.
Automatically generated from core.js
Chain Update Service Object - Providing methods of update
. All method listed here can only be used internally using jQuery.Chain.service
or jQuery.Chain.extend
Automatically generated from update.js
Default Handler
Automatically generated from update.js
Also known as update(fn)
If you pass a function to update, it will bind it to the update event. just like jQuerys click()
or mouseover()
.
see jQuery.Chain.services.update.handler
Automatically generated from update.js
// assuming #person is already chained $('#person').update(function{ alert($(this).item().name); }); $('#person').item({name: 'Rizqi'})
Also known as update(opt)
If no argument or "hard" is passed, it will update the element and trigger the update event.
see jQuery.Chain.services.update.handler
Automatically generated from update.js
$('#person').update();
Chain Binding Service Object - Providing methods of chain
. All method listed here can only be used internally using jQuery.Chain.service
or jQuery.Chain.extend
Automatically generated from chain.js
Initializer. Executed once at the first time chain
invoked.
Automatically generated from chain.js
Default handler.
Automatically generated from chain.js
Also known as chain(updater)
Updater Handler. If you pass an object to chain
, it will treated as a updater object. The updater is a hash of selector and value string: like chain({'my css selector': 'My Content String'})
or chain({'my css selector': {attributes}})
Automatically generated from chain.js
$(selector) .chain({ // Items anchor, where the Item iteration should be placed anchor: anchor, // If true, the default updater is overridden override: false, // Use custom builder builder: function(){}, // Update the element self self: "This is my {data}", // Use css selector to update child element '.element.selector': "Using String Updater", // Use Function as updater '.element.selector': function(data, el){}, // Updating Attributes '.element.selector': { attribute1: "{attribute}", className: "{className}", content: "This is the {content}", value: "This is the {value}" } });
$('<div><span class="name">Name</span></div>') .item({name: 'Steve Jobs'}) .chain() .appendTo(document.body);
$('<div><div class="name"><span class="first">First</span> <span class="last">Last</span></div></div>') .item({first:'Steve', last:'Jobs'}) .chain({ '.name .first': { style: 'color: blue;', content: 'First Name: {first}' }, '.name .last': 'Family Name: {last}' }) .appendTo(document.body);
$('<div><div class="name">Name</div><div class="address">Address</div></div>') .item({name:'Steve Jobs', address:'Cupertino'}) .chain({ builder: function(){ var data = this.item(); this.find('.name').click(function(){alert(data.name)}); this.find('.address').mouseout(function(){alert(data.address)}); }, '.name': '{name}', '.address': '{address}' }) .appendTo(document.body);
Also known as chain(fn)
Builder Handler. If you pass a function to chain
, it will be handled as {builder: function}
, enabling you to use the default updater while customizing the events etc.
see jQuery.Chain.services.chain.handleUpdater
Automatically generated from chain.js
$('<div><div class="name">Name</div><div class="address">Address</div></div>') .item({name:'Steve Jobs', address:'Cupertino'}) .chain(function(){ this.bind('click', function(){ var data = this.item(); alert('name:'+data.name+', address:'+data.address); }); // if you return false, default builder wont be executed // You don't have to return true; return true; }) .appendTo(document.body);
Default Builder - Automatic Data filler
see jQuery.Chain.services.chain.createBuilder
Automatically generated from chain.js
Builder Generator (Wrapper).
see jQuery.Chain.services.chain.defaultBuilder;
Automatically generated from chain.js
Set Anchor (Container for items
to be populated, default: this.element
)
see jQuery.Chain.services.chain.$anchor
Automatically generated from chain.js
Also known as chain('anchor')
Set new Anchor and rerender if new anchor passed. Otherwise return current anchor. If you use items()
with chain()
, you can use chain('anchor', selector)
to move the element, where the items will be generated.
Automatically generated from chain.js
$('#persons').chain('anchor', '.wrapper'); // Define Anchor directly while building $('#persons').items([...]).chain({anchor:'.wrapper', builder: ...});
Also known as chain('template')
Getting/Switching Template.
Automatically generated from chain.js
$(selector).chain('template') // Returns current Template (jQuery Object) $(selector).chain('template', 'raw') // Returns raw HTML Templates (all) $(selector).chain('template', nr) // Switch to template nr (read: Number) $(selector).chain('template', '.tree-column') // Switch by selector
Also known as chain('builder')
Get/Change Builder. If you don't pass any argument, it will return the created builder.
Automatically generated from chain.js
$('#el').chain('builder') // returns builder function $('#el').chain('builder', newBuilder) // Replace Builder
Also known as chain('active')
Check status
Automatically generated from chain.js
Also known as chain('plugin')
Add/Remove Plugins that extend builder
Automatically generated from chain.js
Also known as chain('clone')
Clone Element unchained, with ID removed.
Automatically generated from chain.js
Also known as chain('destroy')
Destroy Chain, restore Element to previous condition.
Automatically generated from chain.js
Chain Item Manager - Providing methods of item
. All method listed here can only be used internally using jQuery.Chain.service
or jQuery.Chain.extend
Automatically generated from item.js
Initializer. Executed once at the first time item
invoked.
Automatically generated from item.js
Default handler.
Automatically generated from item.js
Also known as item(object)
Edit/Bind Item. If no Object defined, it will bind the object to the Item, otherwise it will alter the object using the provided object.
see jQuery.Chain.services.item.handler
Automatically generated from item.js
$('#element').item({name:'Rizqi', country:'Germany'}); $('#element').item({country:'Indonesia'}); $('#element').item(); // Returns {name:'Rizqi', country:'Indonesia'}
Also known as item(fn)
Add setter and getter to item. This function will change the way item(object)
and item()
works.
Automatically generated from item.js
$(element).item(function(oldval, newval){ //setter if(newval) return $.extend(oldval, newval); //getter else return oldval; })
Also known as item()
Get Data if no argument passed.
Automatically generated from item.js
Data Getter Wrapper Function
Automatically generated from item.js
Data Setter Wrapper Function
Automatically generated from item.js
Default Getter/Setter
Automatically generated from item.js
Update element. Wrapper for jQuery.Chain.services.item.element.update
Automatically generated from item.js
Build item, apply builder and plugins
see jQuery.Chain.services.item.$update
Automatically generated from item.js
Also known as item('update')
Item Updater, called within $(element).update()
Automatically generated from item.js
Also known as item('replace')
Replace Data with new data
Automatically generated from item.js
$(element).item('replace', data);
Also known as item('remove')
Remove Item And destroy it.
Automatically generated from item.js
Also known as item('active')
Check Status of item
Automatically generated from item.js
Also known as item('root');
Get/Set Root element.
Automatically generated from item.js
Also known as item('backup')
Backup Item to the state before being built.
Automatically generated from item.js
Also known as item('link')
Bind Item to other (chained) element. If one of them is updated, the linked element will be updated.
"self"
if linked to item)
see jQuery.Chain.services.items.collection
Automatically generated from item.js
Also known as item('destroy')
Destroy item service.
Automatically generated from item.js
Chain Items Manager - Providing methods of items
. All method listed here can only be used internally using jQuery.Chain.service
or jQuery.Chain.extend
Automatically generated from items.js
Collection of Function for getting items
see jQuery.Chain.services.items.collection
Automatically generated from items.js
Get all items, including hidden
Automatically generated from items.js
Get all visible items
Automatically generated from items.js
Get all hidden items
Automatically generated from items.js
Get self
Automatically generated from items.js
Initializer. Executed once at the first time items
invoked.
Automatically generated from items.js
Default handler.
Automatically generated from items.js
Also known as items(object)
If a Data Object is given, it will return the item element containing the object if it exists, otherwise empty.
Automatically generated from items.js
Also known as items(element)
If a jQuery Element is given, it will return itself if it is part of the items, otherwise empty jQuery object.
Automatically generated from items.js
Also known as items(array)
If array is given, it will merge it to current items
Automatically generated from items.js
Also known as items(number)
If number is given, it will get the object with the current number. Use -1 to get the last number.
Automatically generated from items.js
Also known as items(true)
If true
is given, it will get all items including the hidden one.
see jQuery.Chain.services.items.collections.all
Automatically generated from items.js
Get collection of items. Define a collection by adding a function argument
Automatically generated from items.js
Also known as items('update')
Items Updater, called by $(element).update()
Automatically generated from items.js
Also known as items('add')
Add item(s). use items('add', 'shift', item)
to add item at the top
Automatically generated from items.js
Also known as items('merge')
Merge items with array of item data
Automatically generated from items.js
Also known as items('replace')
Replace items with new items array
Automatically generated from items.js
Also known as items('remove')
Remove item
Automatically generated from items.js
Also known as items('reorder')
Reorder Item
Automatically generated from items.js
Also known as items('empty')
Clear all items
Automatically generated from items.js
Also known as items('data')
Like items()
but returns array of data instead of the jQuery object.
Automatically generated from items.js
Also known as items('link')
Bind Items to other (chained) element. If one of them is updated, the linked element will be updated.
"self"
if linked to item)
see jQuery.Chain.services.items.collection
Automatically generated from items.js
Also known as items('index')
Get index of an Item
Automatically generated from items.js
Also known as items('collection')
Get collection of items. Define a collection by adding a function argument
Automatically generated from items.js
Also known as items('active')
Check Status of items
Automatically generated from items.js
Also known as items('backup')
Backup Item to the state before being built.
Automatically generated from items.js
Also known as items('destroy')
Destroy items service.
Automatically generated from items.js
Filtering subroutine
Automatically generated from items.js
Also known as items('filter')
Filter items by criteria. Filtered items will be hidden.
Automatically generated from items.js
Sorting subroutine
Automatically generated from items.js
Also known as items('sort')
Sort items by property.
Automatically generated from items.js
Register a service to the service manager.
Automatically generated from core.js
$.Chain.service('test', { // Default command handler handler: function(option) { // do something }, // $(selector).test('what', somearg) $what: function(somearg) { // do something } }); $('#element').test();
Extends service functionalities.
Automatically generated from core.js
Check whether it is a jQuery Object
Automatically generated from core.js
jobject
$.Chain.jobject($()) // returns true $.Chain.jobject("test") // returns false
Check whether two jQuery Collection identic
Automatically generated from core.js
jidentic
a = $('div'); b = $('div'); c = $('div.test'); (a == b) //returns false $.Chain.jidentic(a, b) // returns true $.Chain.jidentic(a, c) // returns false