zoukankan      html  css  js  c++  java
  • Draggable

    1.<div id="tb" style="padding:3px">  
    2.    <span>Item ID:</span>  
    3.    <input id="itemid" style="line-height:26px;border:1px solid #ccc">  
    4.    <span>Product ID:</span>  
    5.    <input id="productid" style="line-height:26px;border:1px solid #ccc">  
    6.    <a href="#" class="easyui-linkbutton" plain="true" onclick="doSearch()">Search</a>  
    7.</div>  
    

     When user enters search values and press search button, the 'doSearch' function will be called:

    1.function doSearch(){   
    2.    $('#tt').datagrid('load',{   
    3.        itemid: $('#itemid').val(),   
    4.        productid: $('#productid').val()   
    5.    });   
    6.}
    

     把checkbox换成radio:

    singleSelect:true,
    columns:[[
           {field:'radio',title:'',30,
                            formatter: function(value,row,index){
                            return '<input type="radio" name="rd" />';
           }}					  
    onClickRow:function(rowIndex, rowData){
                        $("input[type=radio]",$("div.datagrid-view2 tr.datagrid-row-selected")).attr("checked","checked");
                    }
    

    Draggable

    Override defaults with $.fn.draggable.defaults.

    Usage Example

    Create a draggable element from markup.

    <div id="dd" class="easyui-draggable" data-options="handle:'#title'" style="100px;height:100px;">  
        <div id="title" style="background:#ccc;">title</div>  
    </div> 

    Create a draggable element using javascript.

        <div id="dd" style="100px;height:100px;">  
            <div id="title" style="background:#ccc;">title</div>  
        </div>  
    $('#dd').draggable({  
        handle:'#title'  
    });

    Properties

    NameTypeDescriptionDefault
    proxy string,function A proxy element to be used when dragging, when set to 'clone', a clone element is used as proxy. If a function is specified, it must return a jQuery object.

    The example below shows how to create a simple proxy object.

    $('.dragitem').draggable({
    	proxy: function(source){
    		var p = $('<div style="border:1px solid #ccc;80px"></div>');
    		p.html($(source).html()).appendTo('body');
    		return p;
    	}
    });
    
    null
    revert boolean If set to true, the element will return to its start position when dragging stops. false
    cursor string The css cursor when dragging. move
    deltaX number The dragged element position x corresponding to current cursor null
    deltaY number The dragged element position y corresponding to current cursor null
    handle selector The handle that start the draggable. null
    disabled boolean True to stop draggable. false
    edge number The drag width in which can start draggable. 0
    axis string Defines the axis which the dragged elements moves on, available value is 'v' or 'h', when set to null will move across 'v' and 'h' direction. null

    Events

    NameParametersDescription
    onBeforeDrag e Fires before dragging, return false to cancel this dragging.
    onStartDrag e Fires when the target object start dragging.
    onDrag e Fires during dragging. Return false will not do dragging actually.
    onStopDrag e Fires when the dragging stops.

    Methods

    NameParameterDescription
    options none Return the options property.
    proxy none Return the drag proxy if the proxy property is setted.
    enable none Enable the drag action.
    disable none Disable the drag action.
  • 相关阅读:
    Mybatis学习01:利用mybatis查询数据库
    SpringBoot_登录注册
    python抓取中科院大学招聘
    centos7设置固定IP
    PIL给图片加水印
    You can ignore those files in your build.gradle
    mysql事件执行时间
    wampserver2.5域名解析错误问题
    Mysql错误消息 语言设置
    js控制select多选
  • 原文地址:https://www.cnblogs.com/ly7454/p/2664499.html
Copyright © 2011-2022 走看看