2017-10-09 42 views
0

L'exportation Excel pour col3 dans jsgriddle jqgrid ci-dessous ne contient aucune donnée.Comment puis-je exporter une colonne calculée dans jqgrid? Colonne virtuelle exportToExcel

Est-ce que quelqu'un sait comment obtenir les données pour exporterToExcel pour les colonnes virtuelles ou calculées?

http://jsfiddle.net/carboncope/7rcsaepo/15/

$("#grid").jqGrid({ 
datatype: "local", 
data: mydata, 
height: 250, 
width: 500, 
colNames: ['id', 'col1', 'col2', 'col3'], 
pager: "#gridpager", 
colModel: [{ 
     name: 'id', 
     index: 'id', 
     width: 60, 
    }, 
    { 
     name: 'col1', 
     index: 'col1', 
     width: 50, 
    }, 
    { 
     name: 'col2', 
     index: 'col2', 
     width: 50 
    }, 
    { 
     name: 'col3', 
     index: 'col3', 
     width: 50, 
     formatter: function(cellvalue, options, rowObject) { 
      var showValue = (parseInt(rowObject.col1) + parseInt(rowObject.col2)); 
      if (showValue) { 
       if (options.isExported) { 
        return showValue; 
       } else { 
        return showValue; 
       } 
      } else { 
       return 'novalue'; 
      } 
     }, 
    } 
], 
caption: "exportToExcel Calculated Column", 

});

Répondre

0

La raison de ceci était un bug dans le code. Le problème est fixed et le code fixe peut être obtenu à partir de GitHub

+0

@carboncope, merci - heureux d'aider –