0

我正在使用以下脚本和以下代码并不断收到错误消息

nCell is undefined

在第 669 行,即

nCell.className += ' '+oCol.sClass;

任何人都可以对此有所了解吗?不幸的是,我无法让 jsFiddle 按需要工作

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/js/bootstrap.min.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/highcharts/3.0.2/highcharts.js"></script>
        <script src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.js"></script>

.

<table class="table table-bordered table-hover table-condensed" id="qipp">
                    <thead>

                        <tr>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="Evaluation & Testing Criteria">Evaluation</a></th>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="Component Projects">Components</a></th>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="Gross Savings 13/24 £'000">Gross</a></th>
                            <th colspan="3" class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="Risk Share - Gross Savings">Risk Share</a></th>
                            <th colspan="2" class="success">YTD</th>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="Total Forecast Delivery In Year">Total</a></th>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="Revised Forecast Delivery In Year (CCG adjusted)">Revised</a></th>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="Variance from Plan & FOT">Variance</a></th>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="Variance from Plan & Adjusted FOT">Variance Adj.</a></th>
                            <th colspan="3" class="success">RAG</th>
                        </tr>
                        <tr>
                            <th class="active"></th>
                            <th class="active"></th>
                            <th class="active"></th>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="GHTF Risk £'000">GHTF</a></th>
                            <th class="active"><a href="#" data-toggle="tooltip" data-placement="top" data-content="CCG Risk £'000">CCG</a></th>
                            <th class="active"></th>
                            <th class="success">Activity</th>
                            <th class="success">Cost</th>
                            <th class="active"></th>
                            <th class="active"></th>
                            <th class="active"></th>
                            <th class="active"></th>
                            <th class="success">Project</th>
                            <th class="success">Savings</th>
                            <th class="success">Recurrent / Trend</th>
                        </tr>
                    </thead>

                    <tbody>
                        <tr>
                            <td class="warning" colspan="15">{THEME 1}</td>
                        </tr>

                        <tr>
                            <td rowspan="5" class="text-center"><a data-content="<strong>Work Programme:</strong> {} <br/> <strong>GCCG Project Lead:</strong> {} <br/> <strong>Finance Lead:</strong> {} <br/> <strong>Information Lead:</strong> {}" title="Information">{NAME}</a></td>
                            <td rowspan="5" class="text-center">0</td>
                            <td rowspan="5" class="text-center">0</td>
                            <td rowspan="5" class="text-center">-</td>
                            <td rowspan="5" class="text-center">-</td>

                            <td>Actual</td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>G</td>
                            <td>G</td>
                            <td>G</td>
                        </tr>

                        <tr>
                            <td>Plan</td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>G</td>
                            <td>G</td>
                            <td>G</td>
                        </tr>
                        <tr>
                            <td>Variance</td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>G</td>
                            <td>G</td>
                            <td>G</td>
                        </tr>
                        <tr>
                            <td>Row #4</td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>G</td>
                            <td>G</td>
                            <td>G</td>
                        </tr>
                        <tr>
                            <td>Row #5</td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td><a data-toggle="modal" href="#myModal1">0</a></td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>0</td>
                            <td>G</td>
                            <td>G</td>
                            <td>G</td>
                        </tr>
                    </tbody>

                </table>
4

2 回答 2

5

DataTables 不支持 TBODY 中的 colspan 或 rowspan....

于 2014-01-09T09:09:14.347 回答
1

还要检查正确的 tr 和 td 编号。必须是相同的数字是thead 和tbody。

于 2014-12-29T05:44:38.363 回答