ligerUI grid自动换行?

 

 

从css下手,然后把组成grid的2个table的tr高度统一,这样就能对齐了:

 

//grid的这个事件,一般来说对表格的二次加工,都是在这个事件里去处理
                onAfterShowData:function()
                {                                
                    $(".l-grid-row-cell-inner").css("height","auto"); //单元格高度自动化,撑开
                    var i=0;
                    $("tr",".l-grid2","#maingrid").each(function ()
                    {                                            
                        $($("tr",".l-grid1","#maingrid")[i]).css("height",$(this).height()); //2个表格的tr高度一致
                        i++;                        
                    });                                            
                },

 

 

拖动列首改变宽度时也要加入对齐代码,举一反三:

 

                onAfterChangeColumnWidth:function()
                {
                    $(".l-grid-row-cell-inner").css("height","auto");
                    var i=0;
                    $("tr",".l-grid2","#maingrid").each(function ()
                    {                                            
                        $($("tr",".l-grid1","#maingrid")[i]).css("height",$(this).height());
                        i++;                        
                    });                
                }

 

你可能感兴趣的:(grid)