[BUGFIX] Grid generates invalid id's for the group view
authorSonja Scholz <ss@cabag.ch>
Fri, 4 Mar 2011 13:06:31 +0000 (14:06 +0100)
committerSonja Scholz <ss@cabag.ch>
Fri, 4 Mar 2011 13:28:29 +0000 (14:28 +0100)
ExtJS generated invalid id's for the group view which
causes javascript errors in IE7. ExtJS only makes HTMLencode
on the groupId which isn't sufficient. Override the method
to generate valid HTML-ids only.

Change-Id: I1e812d8296e90618d10c8b1032758254772ed681
Resolves: #13580

typo3/sysext/workspaces/Resources/Public/JavaScript/component.js

index 34522bf..88f6487 100644 (file)
@@ -58,6 +58,19 @@ Ext.override(Ext.XTemplate, {
        }
 });
 
+Ext.override(Ext.grid.GroupingView, {
+       constructId : function(value, field, idx) {
+               var cfg = this.cm.config[idx],
+                       groupRenderer = cfg.groupRenderer || cfg.renderer,
+                       val = (this.groupMode == 'value') ? value : this.getGroup(value, {data:{}}, groupRenderer, 0, idx, this.ds);
+
+               var id = this.getPrefix(field) + val;
+               id = id.replace(/[^a-zA-Z0-9_]/g, '');
+               return id;
+       }
+});
+
+
 TYPO3.Workspaces.RowDetail.rowDetailTemplate = new Ext.XTemplate(
        '<div class="t3-workspaces-foldoutWrapper">',
        '<tpl for=".">',
@@ -290,4 +303,4 @@ TYPO3.Workspaces.MainStore = new Ext.data.GroupingStore({
                },
                scope : this
        }
-});
\ No newline at end of file
+});