如何在javascript模型表中突出显示颜色的多选行?

时间:2016-10-12 12:33:34

标签: javascript jquery html css3

我面临问题相关的背景颜色变化提交(表格行)需要在那里(商店)当我 通过模态(比如分页概念,它的一页有一些有限数量的记录)下一个和上一个按钮,但是当我提交下一个和上一个按钮时,每次刷新页面的代码就像它一样。我怎么能解决这个问题?

和第二次,当我选择行时,数据进入列表提交之前,当我删除行时不删除该表行的颜色,请帮助我任何建议是受欢迎的???下面是我的代码..

代码

function popRoleNext(){
  $("#roleAddTable > tr").remove();
  current=current+incremVal;
  popRole();
 }
 function popRolePrev(){
 $("#roleAddTable > tr").remove();  
current=current-incremVal;
  popRole();
 }

表格的Html部分

 <table class="table table-striped table-bordered" id="roleAddTableMain">
       <thead>
         <tr>
           <!-- <th class="col-sm-5">Role Id</th> -->
           <th class="col-sm-6">Role Description</th>              
         </tr>
       </thead>
       <tbody id="roleAddTable">

       </tbody>
    </table>
         </div>

用于检索数据的表格的一部分

function popRole(){      
     var roleAddTableValue="";

 for(var i=current;i<current+incremVal;i++){ 
     if(i>=arrCount) {//hide next button
        $("#popRoleNextBtn").prop('disabled', true);
     break;
        }else if(arrCount==(current+incremVal)) {
            $("#popRoleNextBtn").prop('disabled', true);
            //break;
        }
        else{
         $("#popRoleNextBtn").prop('disabled', false);
        } 

     if(current<=0){
     $("#popRolePrevBtn").prop('disabled', true);

     }else{

        $("#popRolePrevBtn").prop('disabled', false);

     }
     var arrValuesSub = arrValues[i].split(':');

     roleAddTableValue = roleAddTableValue+"<tr>";

           roleAddTableValue = roleAddTableValue+"<td id='"+arrValuesSub[0]+"' class='modelRoleId'>"+arrValuesSub[1]+"</td>";

              roleAddTableValue = roleAddTableValue+"</tr>";
  }
 $("#roleAddTable").append(roleAddTableValue);
 }

0 个答案:

没有答案