@@ -38,7 +38,7 @@ namespace Providers.DataGrid.Wijmo.Feature {
38
38
OSFramework . DataGrid . Interface . IBuilder ,
39
39
OSFramework . DataGrid . Interface . IDisposable
40
40
{
41
- private _currGroupDescription : Array < wijmo . collections . PropertyGroupDescription > ;
41
+ private _currGroupDescription = new Array < wijmo . collections . PropertyGroupDescription > ( ) ;
42
42
private _grid : Grid . IGridWijmo ;
43
43
private _groupPanel : wijmo . grid . grouppanel . GroupPanel ;
44
44
private _panelId : string ;
@@ -104,11 +104,33 @@ namespace Providers.DataGrid.Wijmo.Feature {
104
104
o : wijmo . collections . ObservableArray /*,
105
105
e: wijmo.collections.NotifyCollectionChangedEventArgs*/
106
106
) => {
107
+ const grid = this . _grid ;
108
+
107
109
//Add and close to the Stack the global value with the last config
108
- this . _grid . features . undoStack . startAction (
109
- new GroupPanelAction ( this . _grid . provider , this . _currGroupDescription )
110
+ grid . features . undoStack . startAction (
111
+ new GroupPanelAction ( grid . provider , this . _currGroupDescription )
110
112
) ;
111
- this . _grid . features . undoStack . closeAction ( GroupPanelAction ) ;
113
+ grid . features . undoStack . closeAction ( GroupPanelAction ) ;
114
+
115
+ const newGroupedDescriptions = o . filter ( ( gd ) => ! this . _currGroupDescription . includes ( gd ) ) ;
116
+ const ungroupedDescriptions = this . _currGroupDescription . filter ( ( gd ) => ! o . includes ( gd ) ) ;
117
+
118
+ // Workaround for HTML tags and encoded symbols being exported in CSV when the Grid present Grouped Columns.
119
+ // Loop through the columns just added to the Group Panel and set isContentHtml to true.
120
+ newGroupedDescriptions . forEach ( function ( groupDesc : wijmo . collections . PropertyGroupDescription ) {
121
+ const col = grid . provider . getColumn ( groupDesc . propertyName ) ;
122
+ if ( col ) {
123
+ col . isContentHtml = true ;
124
+ }
125
+ } ) ;
126
+
127
+ // Loop through the group descriptions just removed from the Group Panel and set isContentHtml to false.
128
+ ungroupedDescriptions . forEach ( function ( groupDesc : wijmo . collections . PropertyGroupDescription ) {
129
+ const col = grid . provider . getColumn ( groupDesc . propertyName ) ;
130
+ if ( col ) {
131
+ col . isContentHtml = false ;
132
+ }
133
+ } ) ;
112
134
113
135
//Updates the global variable wih the current config
114
136
this . _currGroupDescription = o . slice ( ) ;
0 commit comments