Administrator
2023-04-19 40ec16bbb7c9d23df625aa31ae42ac36e901749d
提交 | 用户 | 时间
58d006 1 function inputreturn(finalcallback,clickcallback)
A 2 {
3     $('.inputreturn').on('keyup.return','input',function(e){
4         var $this=$(this);
5         var tr=$this.parents('.inputreturn tr');
6         var inputs=tr.find('input');
7         var maxindx=inputs.size()-1;
8         var $indx=inputs.index($this);//$this.index(inputs);
9         if($indx<0)
10             return;
11         if($indx>=maxindx)
12         {
13             if(finalcallback!=undefined)
14                 finalcallback(inputs.eq($indx));
15         }else{        
16             inputs.eq($indx+1).focus();
17             if(clickcallback!=undefined)
18                 clickcallback($this);
19         }
20     });
21
22
23 }
24
25 jQuery(document).ready(function($) {
26     $('table.table-click').on('click','tr',function(){
27         var $this=$(this);
28         if($this.is('.active'))
29             return;
30         $this.parent('tbody').find('tr.active').removeClass('active');
31         $(this).addClass("active");
32     });
33 });