made an example that will do what you need based on parsing the text in
the <dd> to determine years there are simpler ways with classes that could be added at server but this works with just the html provided. I used a <select> to show will insert before and after list if applicable http://jsbin.com/inayo Dave Maharaj :: WidePixels.com wrote: Sorry, my bad. Each Education is in its own div. They are sorted on initial page load thru php. The id's are generated unique Id's so they look like 125kj6756 and so on. Not sorted by id but by the complated date inside the DIV prior to the page loading. <div id="education_{id}'> html code <dl> <dt>education title</dt> <dd>School</dd> <dd>Completed 2007</dd> </dl> <div id="education_{id}'> html code <dl> <dt>education title</dt> <dd>School</dd> <dd>Completed 2004</dd> </dl> <div id="education_{id}'> html code <dl> <dt>education title</dt> <dd>School</dd> <dd>Completed 2001</dd> </dl> ________________________________From: Charlie [mailto:charlie...@gmail.com] Sent: October-26-09 5:40 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Sort after insert append? a lot depends on html , are these lists, tables, text etc?? hard to guess what you need Dave Maharaj :: WidePixels.com wrote: I have a list of Educations that are ordered by Date Completed. Same page I have an ajax form to add new education. How can I insert the new education where it should go chronologically? Example: 2005 1997 And user add's new Education for 2002 how can I have that be inserted between 2005 and 1997? Thanks, Dave |
- [jQuery] Sort after insert append? Dave Maharaj :: WidePixels.com
- [jQuery] Re: Sort after insert append? Charlie
- [jQuery] Re: Sort after insert app... Dave Maharaj :: WidePixels.com
- [jQuery] Re: Sort after insert... Charlie
- [jQuery] Re: Sort after in... Dave Maharaj :: WidePixels.com