-
Notifications
You must be signed in to change notification settings - Fork 26
CssClassSetImpl._validateToken #106
Comments
Actually there are some issues with classes.add method. Now it cannot get a string containing several styles or empty string. To add several classes simultaneously addAll method should be used |
Thanks for reporting. I'll check it. |
I was having the same problem, but thanks to the hint above about classes.add, I coded a workaround. I'm still using v0.0.18, but this worked for me: In _createColumnHeaders, instead of adding an empty string, I add an innocuous class as follows: In _appendRowHtml, instead of adding "rowCss", I split it into a List and addAll, as follows: In _appendCellHtml, instead of adding "cellCss", I split it into a List and addAll, as follows: |
Fixed by @gonzalopezzi 👍 |
I recieve this exception while running examples using dart sdk 1.10.0 and dartium 39.0.2171.0:
Exception: Uncaught Error: Invalid argument (value): Not a valid class token: ""
Stack Trace:
#0 CssClassSetImpl._validateToken (file:///Volumes/data/b/build/slave/dartium-mac-full-stable/build/src/dart/sdk/lib/html/html_common/css_class_set.dart:13)
#1 CssClassSetImpl.add (file:///Volumes/data/b/build/slave/dartium-mac-full-stable/build/src/dart/sdk/lib/html/html_common/css_class_set.dart:108)
#2 BwuDatagrid._createColumnHeaders (package:bwu_datagrid/bwu_datagrid.dart:749:21)
#3 BwuDatagrid._finishInitialization (package:bwu_datagrid/bwu_datagrid.dart:369:7)
#4 BwuDatagrid._init (package:bwu_datagrid/bwu_datagrid.dart:333:7)
#5 BwuDatagrid.setup. (package:bwu_datagrid/bwu_datagrid.dart:184:9)
#6 Future.Future. (dart:async/future.dart:118)
#7 Timer._createTimer. (dart:async-patch/timer_patch.dart:16)
#8 _Timer._Timer. (dart:html:42314)
I guess, they included css validation, and last line of code below sets empty string for a style, which is not a valid css.
var header = (new dom.Element.tag(
'bwu-datagrid-header-column') as BwuDatagridHeaderColumn)
..classes.add('ui-state-default')
..classes.add('bwu-datagrid-header-column')
..append(nameElement)
..style.width = "${m.width - _headerColumnWidthDiff}px"
//..attributes["id"] ='${uid}${m.id}'
..attributes["id"] = '${m.id}'
..attributes["title"] = m.toolTip != null ? m.toolTip : ""
..attributes['ismovable'] = '${m.isMovable}'
..column = m
..classes.add(m.headerCssClass != null ? m.headerCssClass : "");
So it should be provided explicitly a header css or last line rewritten not providing empty string as a class.
Thank you.
The text was updated successfully, but these errors were encountered: