【问题标题】:flexigrid not working with html tableflexigrid 不适用于 html 表格
【发布时间】:2011-06-13 17:56:12
【问题描述】:

在为 HTML 表格加载 flexigrid 时需要帮助。我有下面的代码,在浏览器中打开这个 html 文件时无法加载 flexigrid(试过 IE、firefox、chrome)。请帮助完成这项工作。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Phone Directory</title>
<link rel="stylesheet" type="text/css" href="css/flexigrid.css" />

<script type="text/javascript" src="jquery-1.6.1.js"></script>
<script type="text/javascript" src="js/flexigrid.js"></script>
<script type="text/javascript">
$('.flexme').flexigrid();
</script>
</head>
<body>

<table id="flexme">
    <thead>
            <tr>
                <th width="100">Col 1</th>
                <th width="100">Col 2</th>
                <th width="100">Col 3 is a long header name</th>
                <th width="300">Col 4</th>

            </tr>
    </thead>
    <tbody>
            <tr>
                <td>This is data 1</td>
                <td>This is data 2</td>
                <td>This is data 3</td>

                <td>This is data 4</td>
            </tr>
            <tr>

                <td>This is data 1</td>
                <td>This is data 2</td>
                <td>This is data 3</td>
                <td>This is data 4</td>
            </tr>

    </tbody>
</table>
</body>
</html> 

【问题讨论】:

  • 试试最新的jquery版本

标签: flexigrid


【解决方案1】:

缺少文档准备功能。

$('.flexme').flexigrid(); 行替换为

$(document).ready(function(){
    $('#flexme').flexigrid();
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-23
    • 2016-10-23
    • 2017-11-09
    • 1970-01-01
    • 1970-01-01
    • 2016-07-16
    • 2016-06-11
    相关资源
    最近更新 更多