rstaib / jquery-bootgrid

Nice, sleek and intuitive. A grid control especially designed for bootstrap.
http://www.jquery-bootgrid.com
MIT License
973 stars 364 forks source link

Tooltip in cell #435

Open mb0hn opened 1 year ago

mb0hn commented 1 year ago

Hello!

I'm looking for a solution to enable tooltips in cells. I tried several tips, without success. Until I tried to change it to text. I did the following in thead:

<th data-header-css-class="col-2" data-column-id="company" data-formatter="company" data-type="text">Company</th> and then in the formatters

                  formatters: {
                     "company": function(column, row)
                      {
                         return "<td class=\"text-left\" data-toggle=\"tooltip\" title=\""+ row.company +"\"> "+ row.company +" </td>";
                      },

It worked, but with side effects. It offsets an empty column and then fills (in the wrong column) the data, containing the tooltips.

Example of operation WITHOUT my changes:

<td class="text-left" style="">5</td>
<td class="text-left" style="">TEST</td>
<td class="text-left" style="">TEST2</td>
<td class="text-left" style="">TEST3</td>

Example with my changes, applied to the second column:

<td class="text-left" style="">5</td>
<td class="text-left" style=""></td>
<td class="text-left" data-toggle="tooltip" title="TEST">TEST</td>
<td class="text-left" style="">TEST2</td>

Detail: the tooltip works, it displays the title with the value TEST, but as we can see, the empty column is present. Any tips? Or is there another way to include tooltip in a cell in Bootgrid?

Grateful