我正在使用ui-grid,並且使用exporterfieldcallback在導出到pdf時基於顏色數組更改字體顏色。它適用於pdf,但是當我輸出到csv時,數據不正確。是否有標誌或字段集,選擇pdf或csv時,我可以區分這兩者嗎?在下面的例子中,當導出到csv時,這是在csv文件中:「displayStatus = {text:displayText,color:'red'};」 我希望做這樣的事情:UI-Grid Exporter問題
`exporterfieldcallback: function(grid, row, col, value) {
if (statusValue === displayValue) {
if(exportFlag === 'pdf'){ // This is what I'm looking for!
// When the pdf is rendered, the colors are perfect.
displayStatus = {text: displayText, color: 'red'};
}else{
displayStatus = displayText;
}
}
return displayStatus;
}`
然後我就可以排除在自定義格式的導出爲CSV。
您能否提供一個突出顯示此問題的簡單示例。請在jsfiddle中創建並分享鏈接 –