javascript
  • html
  • jqgrid
  • 2016-04-06 74 views 0 likes 
    0

    我的網格出現問題,加載數據並啓用垂直滾動後,我發現我的網格在我的行之後加載了額外的空間。我想刪除,任何想法,爲什麼我得到這個?Jqgrid,啓用垂直滾動時出現額外的空白空間

    這是我與滾動條 My grid

    該網格的問題 enter image description here

    我只想滾動條停在20號,我不希望所有的額外空間。

    這是我的網格設置:

    $html .=  '$("#'. $this->_name .'").jqGrid({'; 
         $html .=   'url:"tools/grid_server_calls.php",'; 
         $html .=   'datatype: "json",'; 
         $html .=   'autoencode: true,'; 
         $html .=   'mtype: "POST",'; 
         $html .=   'postData:{inputs:'. $this->_server_inputs .'},'; 
         $html .=   'gridview: true,'; 
         $html .=   'ignoreCase: true,'; 
         //$html .=   'loadui: "block",'; 
    
         $html .=   'hidegrid: false,'; 
    
         $html .=   'width: "' . $this->_width_grid . 'px",'; 
         $html .=   'forceFit: true,'; 
         $html .=   'pager: "#pager_'.$this->_name.'",'; 
         $html .=   'rowNum: ' . $this->_rowNum . ','; 
         $html .=   'rowList: [' . $this->_rowList . '],'; 
    
         if($this->_scroll_enabled){ 
           $html .=   'scroll: true,'; 
           $html .=   'height: "230px",'; 
         } 
         else{ 
          $html .=   'height: "auto",'; 
         } 
    
         $html .=   'viewrecords: true,'; 
         $html .=   'emptyrecords:"'.$this->_message_no_records.'",'; 
         $html .=   'recordtext:"{0} - {1}/{2}",'; 
         $html .=   'altRows: true,'; 
         $html .=   'multiselect: "' . $this->_multiselect .'",'; 
         $html .=   'altclass: "color_line_grid",'; 
         $html .=   'caption: "' . $this->_caption . '",'; 
         $html .=   'colNames: [' . $this->_colNames . '],'; 
         $html .=   'colModel: [' . $this->_colModel . '],'; 
         $html .=   'sortname: "' . $this->_initialSort . '",'; 
         $html .=   'sortorder: "asc",'; 
    
         if(!$this->_search_enabled){ 
          $html .=   'pgbuttons: false,'; 
          $html .=   'pgtext: null,'; 
          $html .=   'rowList: [],'; 
          $html .=   'cmTemplate: {sortable:false},'; 
         } 
    

    回答

    0

    我抓住了問題的根源,它是作爲學習問愚蠢的問題之前閱讀,其實你不需要設置滾動真那麼簡單,你只需要設置一個高度,當數據超過設置的高度時,滾動條會自動出現在我的案例中。

    相關問題