yii-dataview
yii-dataview copied to clipboard
GridView empty column options
The current available options for GridView empty column are $emptyCell, $emptyText, and $emptyTextOptions.
Is there any configuration like $emptyColumnOptions or similar function ?
From yii\grid\Gridview source line 489:
return "<tbody>\n<tr><td colspan=\"$colspan\">" . $this->renderEmpty() . "</td></tr>\n</tbody>";
| Q | A |
|---|---|
| Yii version | 2.0.12 |
what exactly should this option do?
Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:
- When does the issue occur?
- What do you see?
- What was the expected result?
- Can you supply us with a stacktrace? (optional)
- Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)
Thanks!
This is an automated comment, triggered by adding the label status:need more info.
it allows to add HTML attributes for the <td> element.
Which, for exsample? Why can't I add them to emptyTextOptions?
$emptyTextOptions allows to add HTML attributes for the <div> element:
<tr><td colspan="4"><div class="empty">No results found.</div></td></tr>
the new $emptyColumnOptions would allow additional HTML attributes for the <td> element:
<tr><td class="empty" colspan="4"><div class="empty">No results found.</div></td></tr>
I know, Why can't I add additional HTML attributes to emptyTextOptions intead new $emptyColumnOptions ? Example please.
for class:
.empty < td : { border: 1px solid black }
Ex: I want to add HTML data-* attributes inside <td> for empty row.
It can't be achieved simply via emptyTextOptions.
Closing since it seems to be quite rare case.