Hi all

I am creating sortable list with the builder. Now i want these sortables to be a sortable aswell. So i wrap a div around them and run sortable create on the main-container.

I have it like so (simplified):

var myLists = new Array(); // start a empty array for push
var mainDiv = 'main'; // some already present div to carry all stuff.

function newList() {
   var sortlist = Builder.node('div', {id:'parent_'+randomId}, [
                       Builder.node('ul', {id:'childsort_'randomId})
                     ]); // wrapping another div around the list for dragging.

   $(mainDiv).appendChild(sortlist); // append to dom
   myLists.push('childsort_'randomId); // push to list array
   reinitAllLists(); // reinit all.
   enableSortable(); // make wrapper div sortable too
}

function reinitAllLists() {
  for(var i=0; i < myLists.length; i++) { // destroy avoids duplicate init automaticly
       new Sortable.create(myLists[i], { some options ..}); // each childsort..
  } // all fine..
}

function enableSortable() { // using wrapper div to make contained sortable list sortable aswell.
   new Sortable.create( mainDiv , {tag:'div', some options}) // changing tag to div, see builder. (parent)

  // i am getting a error here.. saying that "this.destroy" is not a function in dragdrop.js ... :(
}

Any ideas why this.destroy is lost ?
it works before but it doesn't like enableSortable..

TIA, -k
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to