关于jquery解析json数据时动态追加tr 指定条数换行问题 实现list的 并列显示效果

                     

 $(document).ready(
                function() {
                    $.ajax({
                        type : "post",
                        url : "event_index!findList.action",
                        dataType : "json",
                        success : function(data, text) {
                            var tr ;
                            $.each(data.list, function(i, ev) {
                                     if((i)%4==0){            
                                           alert(i);
                                         tr = [
                                                '',ev.eventId, '',
                                                '',ev.eventName, '',
                                                '',ev.eventDesc, '',
                                                 ].join('');    
                                                 $("#datas").append("");
                                     }else{
                                         tr = [
                                                '',ev.eventId, '',
                                                '',ev.eventName, '',
                                                '',ev.eventDesc, '',
                                                 ].join('');    
                                     }
                                     $("#datas").append(tr);
                            }
                            );                    
                        }
    })
});



你可能感兴趣的:(关于jquery解析json数据时动态追加tr 指定条数换行问题 实现list的 并列显示效果)