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" οnclick="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:'',width: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="width:100px;height:100px;">  
    <div id="title" style="background:#ccc;">title</div>  
</div> 

Create a draggable element using javascript.

    <div id="dd" style="width:100px;height:100px;">  
        <div id="title" style="background:#ccc;">title</div>  
    </div>  
$('#dd').draggable({  
    handle:'#title'  
});
Properties
NameTypeDescriptionDefault
proxystring,functionA 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;width:80px"></div>');
		p.html($(source).html()).appendTo('body');
		return p;
	}
});
null
revertbooleanIf set to true, the element will return to its start position when dragging stops.false
cursorstringThe css cursor when dragging.move
deltaXnumberThe dragged element position x corresponding to current cursornull
deltaYnumberThe dragged element position y corresponding to current cursornull
handleselectorThe handle that start the draggable.null
disabledbooleanTrue to stop draggable.false
edgenumberThe drag width in which can start draggable.0
axisstringDefines 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
onBeforeDrageFires before dragging, return false to cancel this dragging.
onStartDrageFires when the target object start dragging.
onDrageFires during dragging. Return false will not do dragging actually.
onStopDrageFires when the dragging stops.
Methods
NameParameterDescription
optionsnoneReturn the options property.
proxynoneReturn the drag proxy if the proxy property is setted.
enablenoneEnable the drag action.
disablenoneDisable the drag action.

转载于:https://www.cnblogs.com/ly7454/archive/2012/08/30/2664499.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值