Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

add with new item

mauriciopasquier edited this page Aug 13, 2012 · 1 revision

If you want an 'add' controller with each inserted item you can do this:

$('.form').nestedFields({
  afterInsert: (item) ->
    item.find(this.addSelector).bind('click', (e) ->
      $('.form').nestedFields('insert'))})

Calling item.find searches inside the new item, and this.addSelector uses the selector we could have defined in nestedFields initialization block.

Clone this wiki locally