GridView的双击等几个事件

【前台】
< script language = " javascript " >         
        function dbclickevent(d)
        {
              window.alert(
" 事件类型: doubleclidk  作用对象:  "   +  d);            
        }
        function clickevent(d)
        {
              window.alert(
" 事件类型: onclick  作用对象:  "   +  d);            
        }
        function gridviewitemkeydownevent(d)
        {
              window.alert(
" 事件类型: gridviewitemkeydownevent  作用对象:  "   +  d);       
        }
        function keydownevent()
        {
               
if event .altkey  &&   event .keycode  >   48   &&   event .keycode  <   54  )            
               {                
                      window.alert(
" 事件类型: formkeydownevent  选中记录数:  "   +  ( parseint( event .keycode)  -   48  )); 
               }                      
        }           
</ script >
 
【后台】
if ( e.row.rowtype  ==  datacontrolrowtype.datarow)
{
         
// 鼠标移动到每项时颜色交替效果
         e.row.attributes.add( " onmouseout " " this.style.backgroundcolor=white;this.style.color=#003399 " );
         e.row.attributes.add(
" onmouseover " " this.style.backgroundcolor=#6699ff;this.style.color=#8c4510 " );

         
// 单击/双击 事件
         
e.row.attributes.add("ondblclick", "dbclickevent(" + e.row.cells[1].text + ")");
         e.row.attributes.add( " onclick " " clickevent( "   +  e.row.cells[ 1 ].text  +   " ) " );

         
e.row.attributes.add("onkeydown", "gridviewitemkeydownevent(" + e.row.cells[1].text + ")"); 

         
// 设置悬浮鼠标指针形状为"小手"
         e.row.attributes[ " style " =   " cursor:hand " ;
         
}

转载于:https://www.cnblogs.com/fhuafeng/archive/2010/07/06/1772340.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值