2017-10-09 3 views
0

아래의 jsfiddle jqgrid에서 col3의 Excel 내보내기에는 데이터가 없습니다.jqgrid에서 계산 된 열을 exportToExcel하려면 어떻게합니까? exportToExcel 가상 열

누구든지 가상 또는 계산 된 열에 대해 exportToExcel에 데이터를 가져 오는 방법을 알고 있습니까?

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", 

});

답변

0

이유는 코드에 버그가 있기 때문입니다. 문제는 fixed이며 고정 코드는 GitHub에서 얻을 수 있습니다

+0

@carboncope, 도와 줘서 고맙습니다. –