利用 jQuery Clone 复制行(7)
var newRowId = cloneRow.attr("id").split("_")[0] + "_" + idx;
cloneRow.attr("id", newRowId);
      var radios = [];
      cloneRow.find("[id]").each(function() {
          var id = $(this).attr("id");
          var oldId = id;
          var name = $(this).attr("name");
        
          id = id.replace(regForId, "$1" + idx);
          $(this).attr("id", id);
        
          var newname = name.replace(regForName, "$1" + idx);
          $(this).attr("name", newname);
         
          if ($(this).hasClass("hasDatepicker")) {
             $(this).removeClass("hasDatepicker");
          }
        
          if ($(this).attr("type") == "checkbox") {
              if($(this).next().attr("for") != "") {
                  $(this).next().attr("for", id);
              }
              if (!needCopyValue) {
               $(this).attr("checked", "");
              }
          }
          else if ($(this).attr("type") == "radio") {          
              id = id.replace(regForRadioId, "$1" + idx);
              $(this).attr("id", id);
        
              var radio = new Object();
	
相关新闻>>
- 发表评论
- 
				
- 最新评论 进入详细评论页>>





