gridLib/jqGrid

jqGrid 크기 설정/변경

dddzr 2021. 9. 12. 21:03

setGridWidth(), setGridHeight()

부모 영역의 크기 기준 퍼센트 설정

.90은 90%이고 +, - 연산이 가능하다

ex)

.90 - 20는 css에서 90% - 20px와 같은 의미

      $("#testGrid").setGridWidth($("#parent_area").width() * .90);
      $("#testGrid").setGridHeight($("#parent_area").height() * .90);

 

$(window).resize()

윈도우 화면 크기에 따라 동적으로 크기 변경

      $(window).resize(function() { 
      $("#testGrid").setGridWidth($("parent_area").width() * .90);
      });