Loading ...
Sorry, an error occurred while loading the content.
 

Re: Drag and Drop: get the new order

Expand Messages
  • vividsilvernl
    Everybody, YUI does (for as far as I know) not have a built-in method to retrieve the (new/sort) list order. I have created a simple function to retieve the
    Message 1 of 3 , Jul 28, 2006
      Everybody,

      YUI does (for as far as I know) not have a built-in method to
      retrieve the (new/sort) list order.
      I have created a simple function to retieve the order using it's
      ancestor-tag, the <UL> and the elements within this tag. This seems
      to work.

      Just thought I share this with you.

      Best regards,
      Maurice.


      --- In ydn-javascript@yahoogroups.com, "uhaetten" <uhaetti@...> wrote:
      >
      > Hi everybody
      >
      > I'm a beginner in AJAX and I found this nice framework of yahoo.
      Now I
      > want to use this drag-and-drop functionality like this:
      >
      > <script type="text/javascript">
      > var dd = []
      > function dragDropInit() {
      > var i = 0;
      > dd[i++] = new ygDDList("#productID#");
      > dd[i++] = new ygDDListBoundary("lihidden");
      > }
      >
      > YAHOO.util.Event.addListener(window, "load", dragDropInit);
      > YAHOO.util.DD.scroll = false;
      > ygDDList.prototype.endDrag = function(e) { reorder();};
      >
      > function reorder() {
      > alert("The new order");
      > }
      > </script>
      >
      >
      > <ul id="list">
      > <li id="#productID#">some content</li>
      > <li id="#productID#">some other content</li>
      > <li id="lihidden" style="visibility:hidden;">Hidden</li>
      > </ul>
      >
      >
      > Now can anyone tell me how to alert the new order after reordering
      in
      > the reorder-function? I hope you understand what I mean. My english
      > isn't that good... :S
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.