yii-dataview icon indicating copy to clipboard operation
yii-dataview copied to clipboard

GridView empty column options

Open khotim opened this issue 8 years ago • 7 comments
trafficstars

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

khotim avatar Aug 03 '17 07:08 khotim

what exactly should this option do?

cebe avatar Aug 03 '17 09:08 cebe

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.

yii-bot avatar Aug 03 '17 09:08 yii-bot

it allows to add HTML attributes for the <td> element.

khotim avatar Aug 03 '17 11:08 khotim

Which, for exsample? Why can't I add them to emptyTextOptions?

githubjeka avatar Aug 04 '17 05:08 githubjeka

$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>

khotim avatar Aug 04 '17 07:08 khotim

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 }

githubjeka avatar Aug 04 '17 08:08 githubjeka

Ex: I want to add HTML data-* attributes inside <td> for empty row. It can't be achieved simply via emptyTextOptions.

khotim avatar Aug 04 '17 09:08 khotim

Closing since it seems to be quite rare case.

samdark avatar Sep 04 '24 13:09 samdark