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

  • 75.5K All Categories
  • 58 Priority support
  • 25K Free community support
  • 1K General
  • 15 Announcements
  • 2.6K DataTables
  • 159 DataTables 2
  • 1.3K DataTables 1.10
  • 94 DataTables 1.9
  • 35 DataTables 1.8
  • 9 CloudTables
  • 2.3K Editor
  • 2.9K Extensions
  • 22 AutoFill
  • 315 Buttons
  • 36 ColReorder
  • 15 ColumnControl
  • 37 DateTime
  • 70 FixedColumns
  • 51 FixedHeader
  • 32 KeyTable
  • 107 Responsive
  • 24 RowReorder
  • 43 Scroller
  • 171 SearchBuilder
  • 202 SearchPanes
  • 109 Select
  • 28 StateRestore
  • 225 Bug reports
  • 68 Feature requests
  • 102 Plug-ins
  • 11 Blog
  • 74 Web-site

DataTables

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

Từ khóa » Html Colspan Dynamic