2016-07-20 10 views
0

Ich habe ein JqGrid in einem Panel Bootstrap und ich kann nicht finden, warum der autowidth:true Parameter nicht funktioniert. Hier ist der jqGrid Code:Free-JqGrid: Autowidth funktioniert nicht in einem Panel Bootstrap

grid.jqGrid({ 
     data: myData, 
     datatype:'local', 
     noDataContent: "Aucune données présente..", 
     loadMessage: "Merci de patienter...", 
     styleUI : 'Bootstrap', 
     colNames: ["Liste des rubriques","Taux Sal","Taux Pat"], 
     colModel: [ 
      { 
       name: "Libelle", template: 'string' 
      }, 
      { 
       name: "txsalrub", template: 'integer',formatter:'number', formatoptions: {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'} 
      }, 
      { 
       name: "txpatrub", template: 'integer',formatter:'number', formatoptions: {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'} 
      } 
      ], 
     // loadonce: true, 
     autowidth:true, 
     // width: 'auto', 
     maxHeight: height 
     // width: null, 
     shrinkToFit: false, 
     // cmTemplate: { autoResizable: true }, 
     // autoResizing: { compact: true }, 
     // autoresizeOnLoad: true 
    }); 

Und hier ist das Ergebnis, das ich habe:

Free JqGrid autowidth not working

Ich habe versuchen viele Lösung, aber nichts Arbeit:/

+0

Welche Version von jqGrid benutzt du und von welchem ​​fork ([freies jqGrid] (https://github.com/free-jqgrid/jqGrid) oder kommerzielles [Guriddo jqGrid JS] (http://guriddo.net/? page_id = 103334)). Sie schreiben in Ihrer Nachricht "Free-JqGrid", aber Sie verwenden 'styleUI: 'Bootstrap'-Option anstelle von' guiStyle: "bootstrap" '(siehe [die Demo] (http: //www.ok-soft-gmbh .com/jqGrid/OK/formEditOnDoubleClick-jqueryui-fa-bootstrap2.htm) als ein Beispiel). Es scheint, dass Sie kommerzielle Guriddo jqGrid JS anstelle von freien jqGrid verwenden. – Oleg

+0

Nein, nein, keine Sorge, ich benutze die kostenlose JqGrid-Version 4.13.3 die styleUI ist ein Fehler – Rhend

+0

Ist das Problem jetzt gelöst? Wenn das Problem weiterhin besteht, stellen Sie bitte die Demo zur Verfügung, die das Problem reproduziert. – Oleg

Antwort

0

Hier ist der Code von meinem Gitter

var grid = $("#decompteUser"); 
     grid.jqGrid('setGridParam', { data: myData }) 
      .trigger('reloadGrid', [{ page: 1}]); 
     grid.jqGrid({ 
      data: myData, 
      datatype:'local', 
      guiStyle: "bootstrap", 
      iconSet: "fontAwesome", 
      colNames: ["N°décompte","Nbj Payés","Brut Payé","Net Payé","Net Imposable","N° Chèque","Date", "Date Paiement"], 
      colModel: [ 
       { 
        name: "iddec", template: 'string' 
       }, 
       { 
        name: "nbjpayedec", template: 'integer',formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, suffix: " J"} 
       }, 
       { 
        name: "mtbrutdec", template: 'integer',formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, suffix: " €"} 
       }, 
       { 
        name: "mtnetdec", template: 'integer',formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, suffix: " €"} 
       }, 
       { 
        name: "mtnetimposdec", template: 'integer',formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, suffix: " €"} 
       }, 
       { 
        name: "numchequedec", template: 'integer' 
       }, 
       { 
        name: "dteditdec", template: 'string',formatter:'date', formatoptions:{srcformat: 'Y/m/d', newformat: 'd/m/Y'} 
       }, 
       { 
        name: "dtpaiementdec", template: 'string',formatter:'date', formatoptions:{srcformat: 'Y/m/d', newformat: 'Y'} 
       } 
       ], 
      maxHeight: height, 
      width:width, 
      grouping:true, 
      groupingView: { 
       groupField : ['dtpaiementdec'], 
       groupOrder: 'desc', 
       groupColumnShow : true, 
       groupText: ['Année : <b>{0}</b>'] 
      } 
     }); 
     $("#decompteUser").jqGrid('setGridParam',{datatype:'local'}).trigger('reloadGrid'); 

Result of JqGrid