JQuery - 选择器中的变量导致代码不起作用

时间:2016-08-08 15:27:16

标签: jquery

我确信这是一个简单的答案,它正盯着我,但我却看不到它。

我正在创建一个简单的表格,用于在电视上显示信息。以下是我正在使用的代码。

以下代码是我遇到的问题。 '#row'+ y +'#steam'不会将我要添加类的表格单元格作为目标。但是,如果我硬编码'#row0 #steam',它就可以正常运行。

if(arr[y].steam == 't'){
    if(!arr[y].steamgoal == '0'){
        if(parseFloat(arr[y].steamcurrent) >= parseFloat(arr[y].steamgoal)){
            $('#row' + y + ' .steam').addClass('complete');
        } else {
            $('#row' + y + ' .steam').addClass('complete-over');
        }
    }
}

根据行数来动态创建行。我确信有一种更有效的方法,但目前,这是一项正在进行中的工作。

switch(y){
    case 0:                             
        $('#row0').html(
            '<td>'+arr[y].id+'</td>' +
            '<td>'+arr[y].customer+'</td>' +
            '<td>'+arr[y].unit+'</td>' +
            '<td>'+arr[y].make+'</td>' +
            '<td>'+arr[y].vin+'</td>' +
            '<td>'+arr[y].arrival+'</td>' +
            '<td>'+arr[y].repairsbegan+'</td>' +
            '<td>'+arr[y].ro+'</td>' +
            '<td>' + countdown + '</td>' +
            '<td class="steam">'+ steam +'</td>' +
            '<td class="chassis">'+ chassis +'</td>' +
            '<td class="mediablast">'+ mediablast +'</td>' +
            '<td class="paintbody">'+ paintbody +'</td>' +
            '<td class="qc">'+ arr[y].qcinitials +'</td>' +
            '<td class="shipped">'+ arr[y].shippingdate +'</td>'    
        )
        break;

        and so on...

HTML很简单。它要么填充switch语句中的数据,要么不填充。

<tr id="row0"></tr>
<tr id="row1"></tr>
<tr id="row2"></tr>
<tr id="row3"></tr>
<tr id="row4"></tr>
<tr id="row5"></tr>
<tr id="row6"></tr>

除了在使用动态选择器时对单元格进行着色外,所有内容都没有任何问题。请帮忙!

编辑:以下完整的Javascript。我确信有一种更有效的方法来执行switch语句,我最终会得到它。请原谅眼睛:)

    $(document).ready(function(){

/*    $('.carousel').slick({
        dots: false,
        infinite: true,
        speed: 700,
        autoplay:true,
        autoplaySpeed: 10000,
        arrows:false,
        slidesToShow: 1,
        slidesToScroll: 1
      });

*/

        var numOfRows = 0;
        var statusIntervalId = window.setInterval(update, 5000);


        function update() {
            $.ajax({
                url: 'check_status_dev.php',
                dataType: 'html',
                success: function(data) {
                    var parsed = JSON.parse(data);
                    var arr = [];

                    for(var x in parsed){
                        arr.push(parsed[x]);
                    }

            //      console.log(arr);

                    if(numOfRows > arr.length){
                        numOfRows = arr.length;
                        location.reload();
                    } else {
                        numOfRows = arr.length;
                    }

                    for(var y = 0; y < arr.length; y++){

                        if(arr[y].arrival == '0000-00-00'){
                            arr[y].arrival = '';
                        } else {
                            var arr_year = arr[y].arrival.substring(0,4);
                            var arr_month = arr[y].arrival.substring(5,7);
                            var arr_day = arr[y].arrival.substring(8,10);

                            switch(arr_month){
                                case '01':
                                    arr_month = 'Jan';
                                break;
                                case '02':
                                    arr_month = 'Feb';
                                break;
                                case '03':
                                    arr_month = 'Mar';
                                break;
                                case '04':
                                    arr_month = 'Apr';
                                break;
                                case '05':
                                    arr_month = 'May';
                                break;
                                case '06':
                                    arr_month = 'Jun';
                                break;
                                case '07':
                                    arr_month = 'Jul';
                                break;
                                case '08':
                                    arr_month = 'Aug';
                                break;
                                case '09':
                                    arr_month = 'Sep';
                                break;
                                case '10':
                                    arr_month = 'Oct';
                                break;
                                case '11':
                                    arr_month = 'Nov';
                                break;
                                case '12':
                                    arr_month = 'Dec';
                                break;
                            }

                            arr[y].arrival = arr_month + ' ' + arr_day + ', ' + arr_year;
                        }

                        if(arr[y].shippingdate == '0000-00-00'){
                            arr[y].shippingdate = '';
                        }


                        if(arr[y].repairsbegan == '0000-00-00'){
                            arr[y].repairsbegan = '';
                            countdown = '';
                        } else {
                            var year = arr[y].repairsbegan.substring(0,4);
                            var month = arr[y].repairsbegan.substring(5,7);
                            var day = arr[y].repairsbegan.substring(8,10);

                            var dateString = year + '/' + month + '/' + day + ' 00:00:00';
                            var compareDate = new Date(dateString);
                            compareDate.setTime(compareDate.getTime() + 46 * 86400000);

                            var now = new Date();
                            var difference = compareDate.getTime() - now.getTime();

                            if(difference <= 0){
                                var seconds = Math.floor(difference/1000);
                                var minutes = Math.floor(seconds/60);
                                var hours = Math.floor(minutes/60);
                                var days = Math.floor(hours/24);

                                var countdown = '<p class="red">' + days + ' Days </p>'
                            } else {
                                var seconds = Math.floor(difference/1000);
                                var minutes = Math.floor(seconds/60);
                                var hours = Math.floor(minutes/60);
                                var days = Math.floor(hours/24);

                                var countdown = '<p class="ontime">' + days + ' Days </p>'

                            }

                            switch(month){
                                case '01':
                                    month = 'Jan';
                                break;
                                case '02':
                                    month = 'Feb';
                                break;
                                case '03':
                                    month = 'Mar';
                                break;
                                case '04':
                                    month = 'Apr';
                                break;
                                case '05':
                                    month = 'May';
                                break;
                                case '06':
                                    month = 'Jun';
                                break;
                                case '07':
                                    month = 'Jul';
                                break;
                                case '08':
                                    month = 'Aug';
                                break;
                                case '09':
                                    month = 'Sep';
                                break;
                                case '10':
                                    month = 'Oct';
                                break;
                                case '11':
                                    month = 'Nov';
                                break;
                                case '12':
                                    month = 'Dec';
                                break;
                            }

                            arr[y].repairsbegan = month + ' ' + day + ', ' + year;
                        }

                                if(arr[y].steam == 't'){
                                    if(!arr[y].steamgoal == '0'){
                                        if(parseFloat(arr[y].steamcurrent) >= parseFloat(arr[y].steamgoal)){
                                            console.log('#row' + y + ' .steam');
                                            console.log($('#row' + y + ' .steam'));
                                            $('#row' + y + ' .steam').addClass('complete');
                                        } else {
                                            $('#row' + y + ' .steam').addClass('complete-over');
                                        }
                                    }
                                }

                                if(arr[y].chassis == 't'){
                                    if(!arr[y].chassisgoal == '0'){
                                        if(parseFloat(arr[y].chassiscurrent) >= parseFloat(arr[y].chassisgoal)){
                                            $('#row' + y + ' .chassis').addClass('complete');
                                        } else {
                                            $('#row' + y + ' .chassis').addClass('complete-over');
                                        }   
                                    }
                                }                               

                                if(arr[y].mediablast == 't'){
                                    if(!arr[y].mediablastgoal == '0') {
                                        if(parseFloat(arr[y].mediablastcurrent) >= parseFloat(arr[y].mediablastgoal)){
                                            $('#row' + y + ' .mediablast').addClass('complete');
                                        } else {
                                            $('#row' + y + ' .mediablast').addClass('complete-over');
                                        }   
                                    }
                                }

                                if(arr[y].paintbody == 't'){
                                    if(!arr[y].paintbodygoal == '0'){
                                        if(parseFloat(arr[y].paintbodycurrent) >= parseFloat(arr[y].paintbodygoal)){
                                            $('#row' + y + ' .paintbody').addClass('complete');
                                        } else {
                                            $('#row' + y + ' .paintbody').addClass('complete-over');
                                        }   
                                    }
                                }

                                if(arr[y].qc == 't'){
                                    $('#row' + y + ' .qc').addClass('complete');
                                }

                                if(arr[y].shipped == 't'){
                                    $('#row' + y + ' .shipped').addClass('complete');
                                }

                                var steam = '';
                                var chassis = '';
                                var mediablast = '';
                                var paintbody = '';

                        switch(y){
                            case 0:                             
                                $('#row0').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 1:
                            $('#row1').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 2:
                            $('#row2').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 3:
                            $('#row3').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'                                
                                )
                            break;
                            case 4:
                            $('#row4').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 5:
                            $('#row5').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 6:
                            $('#row6').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 7:
                            $('#row7').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'                        
                                )
                            break;
                            case 8:
                            $('#row8').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'                                
                                )
                            break;
                            case 9:
                            $('#row9').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 10:
                            $('#row10').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 11:
                            $('#row11').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 12:
                            $('#row12').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 13:
                            $('#row13').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 14:
                            $('#row14').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 15:
                            $('#row15').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 16:
                            $('#row16').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 17:
                            $('#row17').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'    
                                )
                            break;
                            case 18:
                            $('#row18').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'        
                                )
                            break;
                            case 19:
                            $('#row19').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 20:
                            $('#row20').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 21:
                            $('#row21').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'            
                                )
                            break;
                            case 22:
                            $('#row22').html(
                                    '<td>'+arr[y].id+'</td>' +
                                    '<td>'+arr[y].customer+'</td>' +
                                    '<td>'+arr[y].unit+'</td>' +
                                    '<td>'+arr[y].make+'</td>' +
                                    '<td>'+arr[y].vin+'</td>' +
                                    '<td>'+arr[y].arrival+'</td>' +
                                    '<td>'+arr[y].repairsbegan+'</td>' +
                                    '<td>'+arr[y].ro+'</td>' +
                                    '<td>' + countdown + '</td>' +
                                    '<td class="steam">'+ steam +'</td>' +
                                    '<td class="chassis">'+ chassis +'</td>' +
                                    '<td class="mediablast">'+ mediablast +'</td>' +
                                    '<td class="paintbody">'+ paintbody +'</td>' +
                                    '<td class="qc">'+ arr[y].qcinitials +'</td>' +
                                    '<td class="shipped">'+ arr[y].shippingdate +'</td>'    
                                )
                            break;
                        }
                    }
                }

            });
        }

    });

0 个答案:

没有答案