DT 2.0 : dt-type-numeric class to cells with FA icons

DT 2.0 : dt-type-numeric class to cells with FA icons

MelodyNelsonMelodyNelson Posts: 132Questions: 21Answers: 2

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Hi,

I've just upgrade to datatable 2.0 (congratulations by the way !)

I'm wondering if it's normal that dt-type-numeric class is added to cells containing an icon <i></i> (font awesome).

Example :

<td class="dt-type-numeric"><i class="fa-solid fa-magnifying-glass" title="Fiche détaillée"></i></td>

<td class="dt-type-numeric"><a data-fancybox="formulaire" data-type="iframe" href="fb_ajouter_personne3cols.htm&tcom1=CM&tcom20=851"><i class="fa-solid fa-user-plus" title="Ajouter une personne"></i></a></td>

I've added a class in the column defs to change the text alignment in theses cases :

    { className: 'icone', targets: [0, 1, 10, 12] }

Also, I'm wondering where I can find the new features, I saw the mention « Since: DataTables 2.0.0 » on some pages of the documentation, try to click on it hoping to see the list (I'm a dreamer, I know...)

Congratulation again for the new version of datables :)

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,497Questions: 1Answers: 10,264 Site admin
    Answer ✓

    Thank you :)

    I'm still working on putting out fires after the 2.0 release, and making sure that I'm on top of the support requests. I've not had a chance to write a blog post about it yet, but that will be coming soon. The complete release notes are available though.

    Regarding the issue you are seeing, I've created a small test case here and I can indeed see that issue. The answer is no, I would not have expected that to happen, but I think I know why it is happening. I'll look into what I can do about that.

    Thanks,
    Allan

  • MelodyNelsonMelodyNelson Posts: 132Questions: 21Answers: 2

    Thank you Allan, I will read the notes.

    I'm already playing with the new layout options :)

    Hope there is not too much fires so you can enjoy the release of all this work and more free time.

  • toxpaltoxpal Posts: 10Questions: 1Answers: 0

    I have the same problem after upgrading to 2.0, but it's slightly different in my case: some cells with FA icon have 'dt-type-numeric' class added automatically, and some haven't.

  • RupertBarrowRupertBarrow Posts: 23Questions: 3Answers: 0

    I have a similar problem : "dt-type-numeric" is being added to cells in a column which has a custom renderer

  • allanallan Posts: 62,497Questions: 1Answers: 10,264 Site admin

    Is your renderer also returning html for icons, or something else?

    Allan

  • adam755adam755 Posts: 4Questions: 1Answers: 0

    I'm also having this issue. Only affects custom render columns when using the "data" source, but works fine with server-side "ajax" source.

  • adam755adam755 Posts: 4Questions: 1Answers: 0
    edited March 18

    Can be fixed by manually setting the column type to "html" in this case.

  • nanonenanone Posts: 3Questions: 1Answers: 0

    Seems this has not been fixed in 2.0.5 yet, as I'm having a similar issue where the dt-type-numeric is added to the header cells where my row cells also contain fontawesome icons.

    As a workaround, if I add &#x200b; (zero width space) between the <i></i> tags, it no longer adds dt-type-numeric.

    Example:

    <i class="fa-solid fa-tv">&#x200b;</i>
    
  • allanallan Posts: 62,497Questions: 1Answers: 10,264 Site admin

    A quick note to say that I've committed a fix to address this problem, and it will be in DataTables 2.1 (it needed an extension to the existing type detection abilities, which I've added for 2.1). Hopefully the release of 2.1 won't be too far away.

    Allan

  • nanonenanone Posts: 3Questions: 1Answers: 0

    Thanks for the reply @allan . Any updates regarding the release date for 2.1?

  • allanallan Posts: 62,497Questions: 1Answers: 10,264 Site admin

    Roughly two weeks time. I'm on holiday next week, and will merge the changes to master as soon as I get back. Give it a week and then release.

    Allan

Sign In or Register to comment.