备份

1: sql语句中取值 

String dztype=jdbcTemplate.queryForObject("select id from ld_dztype a where a.dz_name = ?", String.class,"已回");
 ldOrderRelation.setOrDztype(dztype);

2:js 追加tr

 $('#addLdcReceiverShipperBtn').bind('click', function(){  
      var tr =  $("#add_ldcReceiverShipper_table_template tr").clone();//捞取模板
      $("#add_ldcReceiverShipper_table").append(tr);//追加
      resetTrNum('add_ldcReceiverShipper_table');
      return false;
    }); 

3:
初始化下标

function resetTrNum(tableId) {

 $tbody = $("#"+tableId+"");
 $tbody.find('>tr').each(function(i){
  $(':input, select,button,a', this).each(function(){
   var $this = $(this), name = $this.attr('name'),id=$this.attr('id'),onclick_str=$this.attr('onclick'), val = $this.val();
   if(name!=null){
    if (name.indexOf("#index#") >= 0){
     $this.attr("name",name.replace('#index#',i));
    }else{
     var s = name.indexOf("[");
     var e = name.indexOf("]");
     var new_name = name.substring(s+1,e);
     $this.attr("name",name.replace(new_name,i));
    }
   }
   if(id!=null){
    if (id.indexOf("#index#") >= 0){
     $this.attr("id",id.replace('#index#',i));
    }else{
     var s = id.indexOf("[");
     var e = id.indexOf("]");
     var new_id = id.substring(s+1,e);
     $this.attr("id",id.replace(new_id,i));
    }
   }
   if(onclick_str!=null){
    if (onclick_str.indexOf("#index#") >= 0){
     $this.attr("onclick",onclick_str.replace(/#index#/g,i));
    }else{
    }
   }
  });
  $(this).find('div[name=\'xh\']').html(i+1);
 });
}

4:会话中获取使用者信息

 TSUser user = ResourceUtil.getSessionUser();
  String name = user.getUserName();

5、下拉框属性

 <t:dgCol title="是否回单" field="orderPptype"    query="true" dictionary="shqsd"  width="120"></t:dgCol>

字典表添加内容   dictionary="shqsd" 

posted @ 2019-12-11 16:07  薛柏梁  阅读(179)  评论(0编辑  收藏  举报