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.
  • 相关阅读:
    Map总结(HashMap, Hashtable, TreeMap, WeakHashMap等使用场景)
    IP地址资源的分配和管理
    破解中常见的指令及修改
    8086 CPU 寻址方式
    汇编指令速查
    关于ida pro的插件keypatch
    动态方式破解apk进阶篇(IDA调试so源码)
    IDA7.0安装keypatch和findcrypt-yara插件
    Android逆向之旅---动态方式破解apk进阶篇(IDA调试so源码)
    IDA动态调试技术及Dump内存
  • 原文地址:https://www.cnblogs.com/ly7454/p/2664499.html
Copyright © 2011-2022 走看看