Jamie Orchard-Hays
2005-Oct-04 13:44 UTC
[Rails-spinoffs] sorting error "Error: item.id has no properties"
I''ve got some sorting working now, but when the page loads and when I drag, I keep getting this error: "Error: item.id has no properties" My <ul> and <li> elements all have ids. Do child elements all need ids? Here''s the code from dragdrop.js where the error is being thrown ( a few lines from the bottom of the file, line 501--HEAD version) serialize: function(element) { element = $(element); var sortableOptions = this.options(element); var options = Object.extend({ tag: sortableOptions.tag, only: sortableOptions.only, name: element.id }, arguments[1] || {}); return $A(element.childNodes).collect( function(item) { return (encodeURIComponent(options.name) + "[]=" + encodeURIComponent(item.id.split("_")[1])); <---------error occurs here! }).join("&"); } Any ideas? Thanks, Jamie
Jamie Orchard-Hays
2005-Oct-04 14:42 UTC
[Rails-spinoffs] SOLVED: sorting error "Error: item.id has no properties"
turns out that having some commented code (an old table row) inside the list element was the problem. Go figure. Jamie On Oct 4, 2005, at 12:56 PM, Jamie Orchard-Hays wrote:> I''ve got some sorting working now, but when the page loads and when > I drag, I keep getting this error: > > "Error: item.id has no properties" > > My <ul> and <li> elements all have ids. Do child elements all need > ids? > > Here''s the code from dragdrop.js where the error is being thrown > ( a few lines from the bottom of the file, line 501--HEAD version) > > serialize: function(element) { > element = $(element); > var sortableOptions = this.options(element); > var options = Object.extend({ > tag: sortableOptions.tag, > only: sortableOptions.only, > name: element.id > }, arguments[1] || {}); > return $A(element.childNodes).collect( function(item) { > return (encodeURIComponent(options.name) + "[]=" + > encodeURIComponent(item.id.split("_")[1])); > <---------error occurs here! > }).join("&"); > } > > Any ideas? > > Thanks, > > Jamie > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Thomas Fuchs
2005-Oct-05 05:05 UTC
[Rails-spinoffs] SOLVED: sorting error "Error: item.id has no properties"
This should be fixed in HEAD. Thomas Am 04.10.2005 um 19:54 schrieb Jamie Orchard-Hays:> turns out that having some commented code (an old table row) inside > the list element was the problem. Go figure. > > Jamie > > > On Oct 4, 2005, at 12:56 PM, Jamie Orchard-Hays wrote: > > >> I''ve got some sorting working now, but when the page loads and >> when I drag, I keep getting this error: >> >> "Error: item.id has no properties" >> >> My <ul> and <li> elements all have ids. Do child elements all need >> ids? >> >> Here''s the code from dragdrop.js where the error is being thrown >> ( a few lines from the bottom of the file, line 501--HEAD version) >> >> serialize: function(element) { >> element = $(element); >> var sortableOptions = this.options(element); >> var options = Object.extend({ >> tag: sortableOptions.tag, >> only: sortableOptions.only, >> name: element.id >> }, arguments[1] || {}); >> return $A(element.childNodes).collect( function(item) { >> return (encodeURIComponent(options.name) + "[]=" + >> encodeURIComponent(item.id.split("_")[1])); >> <---------error occurs here! >> }).join("&"); >> } >> >> Any ideas? >> >> Thanks, >> >> Jamie >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >