• 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.
  • 相关阅读:
    Cordova 配置文件
    Mac 配置gradle环境变量
    React实现TabBar切换,带动画效果
    【Mac】基于Android Studio搭建cordova开发环境
    Spring之IOC控制反转
    Spring Boot笔记三:Spring Boot之日志
    Spring Boot笔记二:Spring Boot配置文件
    java的代理机制
    Spring Boot笔记一:Spring Boot入门
    Spring Boot笔记
  • 原文地址:https://www.cnblogs.com/ly7454/p/2664499.html
Copyright © 2020-2023  润新知