jquery jtable 在 php 中未显示在前端表记录中


Jquery jtable in php not showing at front end table record

使用 jquery jtable 但不显示记录列表...在前端,当数据库中有 10 条记录时,此显示数据不可用。

    <link href="themes/redmond/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
    <link href="Scripts/jtable/themes/lightcolor/blue/jtable.css" rel="stylesheet" type="text/css" />
    <script src="jquery-1.6.4.min.js" type="text/javascript"></script>
    <script src="jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script src="jquery.jtable.min.js" type="text/javascript"></script>
    <script src="jquery.jtable.js" type="text/javascript"></script>
    <script type="text/javascript">
        jQuery(document).ready(function() {
            //Prepare jTable
            jQuery('#PeopleTableContainer').jtable({
                title: 'Table of people',
                paging: true,
                pageSize: 2,
                sorting: true,
                defaultSorting: 'Name ASC',
                actions: {
                    listAction: 'PersonActions.php?action=list',
                    createAction: 'PersonActions.php?action=create',
                    updateAction: 'PersonActions.php?action=update',
                    deleteAction: 'PersonActions.php?action=delete'
                },
                fields: {
                    id: {
                        key: true,
                        create: false,
                        edit: false,
                        list: false
                    },
                    name: {
                        title: 'Author Name',
                        width: '40%'
                    },
                    age: {
                        title: 'Age',
                        width: '20%'
                    },
                    RecordDate: {
                        title: 'Record date',
                        width: '30%',
                        type: 'date',
                        create: false,
                        edit: false
                    }
                }
            });
            //Load person list from server
            jQuery('#PeopleTableContainer').jtable('load');
        });
    </script>

</head>
<body>
    <div id="PeopleTableContainer"></div>
</body>

您必须检查其他页面"PersonActions.php"。

首先,您必须在位置中直接输入表格字段如果字段类似于(ID,姓名,年龄,日期)你必须像这样输入

fields: {
    id: {
        key: true,
        create: false,
        edit: false,
        list: false
    },
    name: {
        title: 'Author Name',
        width: '40%'
    },
    age: {
        title: 'Age',
        width: '20%'
    },
    date: {
        title: 'Record date',
        width: '30%',
        type: 'date',
        create: false,
        edit: false
    }
}

在"PersonActions.php"中,您必须检查连接,查询和所有内容