makes the html code
I mean, even a blank value will be added to the class
cssClassExpression is from CgridColumn of course)
fixed empty css class attribute for CGridColumn
problem also existed in CGridView now also fixed in CGridColumn.
I'm not sure this is a problem/bug in the first place.
@smertnik77, where are you looking when you conclude that the result is <td class></td>? I am guessing you looked in Chrome's developer tools or something like that, and not in the actual HTML source code that is sent to the browser.
Looking at the diffs from @cebe's commits, my impression is that what was previously output isn't <td class></td> but rather <td class=""></td>, and IMO that is valid HTML. It's just a class attribute that doesn't have any classes in it.
I also tested this now and I do get the class="" for the following code:
If on the other hand people prefer not to have the class output when it's empty, I think that's fine. But it's hardly a bug.
I agree with @rawtaz the output is all standard as the quotes are there, so this "fix" is not really needed but if it's requested we can add it.
So do we want to "fix" it? @mdomba @samdark @qiangxue ?
One other case that can occur is <tr class="myclass "> with a whitespace inside attribute value, but I think it is still valid html then.
<tr class="myclass ">
@smertnik77 was your bug report about the missing ="" or about an empty class attribute?
IMO it would be more elegant to have clean HTML code so I'm for adding this simple fix.
Thats also how I see it, vote for it. @rawtaz changed label from Bug -> Enhancement ;-)
Agree with @mdomba about having clean HTML code, so good micro-enhancement.
Good @cebe. We should do this with many more issues marked as bugs, i.e. make them features ;)
@cebe - about an empty class attribute, I know english bad, sorry
CGridview does not create empty class attribute
fixes #1163 where rowCssClassExpression or rowCssClass could be empty
for certain rows.
added changelog line for issue #1163