其他分享
首页 > 其他分享> > ecology8给明细表新增行按钮绑定自定义点击事件

ecology8给明细表新增行按钮绑定自定义点击事件

作者:互联网

var tbgs = 'field15053_';
jQuery(function () {
	if(typeof addRow0==="undefined"){//非操作节点,不执行后续代码
        return;
    }
	try {			
		var oaddRow0 = addRow0;
			addRow0 = function(){//重写addRow0,0指明细表1
				var id='field15052_';
				oaddRow0.apply(this, arguments);//执行原按钮事件(新增空行)
				//自定义操作
				jQuery("input[name^="+id+"]").each(function(){
					var  index = jQuery(this).attr("id").split('_')[1];
					//添加失去焦点事件监听
					jQuery("#"+tbgs+index).blur(function(){
						if(jQuery(this).val()>jQuery('#'+id+index+"span").html())
						{
							alert("填报工时不能大于可报工时");
							jQuery(this).val("");
							jQuery(this).focus();
						}
					});
			});
		}
	} catch(e) {}
});

标签:jQuery,function,自定义,index,addRow0,明细表,var,ecology8,id
来源: https://www.cnblogs.com/lroy/p/12564145.html