示例#1
0
def sortable_element(element_id, **options):
    """
    Make the element with the DOM ID specified by ``element_id`` sortable.
    
    Uses drag-and-drop and makes an Ajax call whenever the sort order has
    changed. By default, the action called gets the serialized sortable
    element as parameters.
    
    Example::

        <% sortable_element("my_list", url=url(action="order")) %>
    
    In the example, the server-side action gets a "my_list" array
    parameter containing the values of the ids of elements the
    sortable consists of, in the current order (like
    ``mylist=item1&mylist=item2``, where ``item1`` and ``item2`` are
    the ids of the ``<li>`` elements).

    Note: For this to work, the sortable elements must have id
    attributes in the form ``string_identifier``. For example,
    ``item_1``. Only the identifier part of the id attribute will be
    serialized.
    
    You can change the behaviour with various options, see
    http://script.aculo.us for more documentation.
    
    """
    return javascript_tag(sortable_element_js(element_id, **options))
示例#2
0
def draggable_element(element_id, **options):
    """
    Makes the element with the DOM ID specified by ``element_id`` draggable.
    
    Example::

        <% draggable_element("my_image", revert=True)
    
    You can change the behaviour with various options, see
    http://script.aculo.us for more documentation.
    """
    return javascript_tag(draggable_element_js(element_id, **options))
def draggable_element(element_id, **options):
    """
    Makes the element with the DOM ID specified by ``element_id`` draggable.
    
    Example::

        <% draggable_element("my_image", revert=True)
    
    You can change the behaviour with various options, see
    http://script.aculo.us for more documentation.
    """
    return javascript_tag(draggable_element_js(element_id, **options))
示例#4
0
def drop_receiving_element(element_id, **options):
    """
    Makes an element able to recieve dropped draggable elements
    
    Makes the element with the DOM ID specified by ``element_id`` receive
    dropped draggable elements (created by draggable_element) and make an
    AJAX call  By default, the action called gets the DOM ID of the element
    as parameter.
    
    Example::
    
        <% drop_receiving_element("my_cart", url=url_for(controller="cart", action="add" )) %>
    
    You can change the behaviour with various options, see
    http://script.aculo.us for more documentation.    
    """
    return javascript_tag(drop_receiving_element_js(element_id, **options))
def drop_receiving_element(element_id, **options):
    """
    Makes an element able to recieve dropped draggable elements
    
    Makes the element with the DOM ID specified by ``element_id`` receive
    dropped draggable elements (created by draggable_element) and make an
    AJAX call  By default, the action called gets the DOM ID of the element
    as parameter.
    
    Example::
    
        <% drop_receiving_element("my_cart", url=(controller="cart", action="add" )) %>
    
    You can change the behaviour with various options, see
    http://script.aculo.us for more documentation.    
    """
    return javascript_tag(drop_receiving_element_js(element_id, **options))
def sortable_element(element_id, **options):
    """
    Makes the element with the DOM ID specified by ``element_id`` sortable.
    
    Uses drag-and-drop and makes an Ajax call whenever the sort order has
    changed. By default, the action called gets the serialized sortable
    element as parameters.
    
    Example::

        <% sortable_element("my_list", url=url(action="order")) %>
    
    In the example, the action gets a "my_list" array parameter 
    containing the values of the ids of elements the sortable consists 
    of, in the current order.
    
    You can change the behaviour with various options, see
    http://script.aculo.us for more documentation.
    """
    return javascript_tag(sortable_element_js(element_id, **options))
def sortable_element(element_id, **options):
    """
    Makes the element with the DOM ID specified by ``element_id`` sortable.
    
    Uses drag-and-drop and makes an Ajax call whenever the sort order has
    changed. By default, the action called gets the serialized sortable
    element as parameters.
    
    Example::

        <% sortable_element("my_list", url=url(action="order")) %>
    
    In the example, the action gets a "my_list" array parameter 
    containing the values of the ids of elements the sortable consists 
    of, in the current order.
    
    You can change the behaviour with various options, see
    http://script.aculo.us for more documentation.
    """
    return javascript_tag(sortable_element_js(element_id, **options))