Colspan On Dynamically Loaded Content — DataTables Forums

DataTables Advanced interactionfeatures for your tables. Editor Comprehensive editinglibrary for DataTables. Manual Download
  • Examples
  • Manual
  • Reference
  • Extensions
  • Plug-ins
  • Blog
  • Forums
    • Discussions
    • Sign In
  • Support
  • FAQs
  • Download
  • Purchase
Show site navigation colspan on dynamically loaded content colspan on dynamically loaded content kiwiskiwis Posts: 15Questions: 10Answers: 0 May 2021 edited May 2021 in DataTables

I'm using this approach

https://datatables.net/forums/discussion/comment/190137/#Comment_190137

And I have two for loops into my fetch result.

First one is a head row. Second one is my normal data.

Currently all is going well. My issue is on my head template I can't have

<script id="refRow" type="text/html"> <tr> <th colspan="4" data-order="{{Surname}}">{{personName}}</th> </tr> </script>

In my HTML I have this

<thead> <tr style="display:none;"> <th></th> <th></th> <th></th> <th></th> </tr> </thead> <tbody> </tbody>

Any ideas, options?

Answers

  • kiwiskiwis Posts: 15Questions: 10Answers: 0 May 2021

    this is the error

    jquery.dataTables.js:3140 Uncaught (in promise) TypeError: Cannot set property '_DT_CellIndex' of undefined at _fnCreateTr (jquery.dataTables.js:3140) at _fnAddData (jquery.dataTables.js:2453) at HTMLTableRowElement.<anonymous> (jquery.dataTables.js:2481) at jquery.min.js:2 at Function.map (jquery.min.js:2) at S.fn.init.map (jquery.min.js:2) at _fnAddTr (jquery.dataTables.js:2479) at _Api.<anonymous> (jquery.dataTables.js:8233) at _Api.iterator (jquery.dataTables.js:7068) at _Api.<anonymous> (jquery.dataTables.js:8231)

  • colincolin Posts: 15,240Questions: 1Answers: 2,599 May 2021

    That error is normally generated when the column count in the header and body and data don't match - so that would be the place to start.

    If that doesn't solve it, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed. Sign In · Register

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Quick Links

  • Categories
  • Recent Discussions
  • Unanswered

Categories

  • 74.4K All Categories
  • 56 Priority support
  • 24.1K Free community support
  • 1K General
  • 14 Announcements
  • 2.5K DataTables
  • 83 DataTables 2
  • 1.3K DataTables 1.10
  • 92 DataTables 1.9
  • 35 DataTables 1.8
  • 9 CloudTables
  • 2.2K Editor
  • 2.8K Extensions
  • 20 AutoFill
  • 310 Buttons
  • 50 ColVis
  • 30 DateTime
  • 68 FixedColumns
  • 50 FixedHeader
  • 32 ColReorder
  • 31 KeyTable
  • 104 Responsive
  • 23 RowReorder
  • 42 Scroller
  • 166 SearchBuilder
  • 193 SearchPanes
  • 107 Select
  • 26 StateRestore
  • 22 TableTools
  • 220 Bug reports
  • 67 Feature requests
  • 100 Plug-ins
  • 11 Blog
  • 70 Web-site

DataTables

DataTables designed and created by SpryMedia Ltd. © 2007-2023 MIT licensed. Privacy policy. Supporters. SpryMedia Ltd is registered in Scotland, company no. SC456502.

Từ khóa » Html Colspan Dynamic