How can i get jqgrid frozen columns to work with word wrap on

前端 未结 6 1702
悲&欢浪女
悲&欢浪女 2020-11-27 07:30

I am using the latest jqgrid 4.3.1 and i am trying to use frozen columns.

The issue is that i have overridden the default css to support word wrap (css solution ca

6条回答
  •  萌比男神i
    2020-11-27 08:21

    I wasn't able to get Oleg's solution to work, but I made something based on his work that is working for me. Not sure if I missed something, but since this is working for me I thought I'd share:

    I also had to add a line to my CSS file

    .frozen-div{overflow:hidden;}
    
     var fixPositionsOfFrozenDivs = function () {
         var originalRowHeightArray = new Array();
         var gridId = $(this).attr("id");
    
         $("#" + gridId).find("tr").each(function () {
             originalRowHeightArray.push($(this).find("td").first().height() + 1);
         });
    
         $rows = $('>div>table.ui-jqgrid-btable>tbody>tr', this.grid.bDiv);
    
         $rows.each(function (i) {
             var rowHight = $($rows[i]).height(), rowHightFrozen = $(this).height();
             $(this).height(originalRowHeightArray[i] + "px");
         });
     };
    

提交回复
热议问题