繁体   English   中英

kendo ui网格数据未从php显示

[英]kendo ui grid data not showing from php

我想将数据显示到我的剑道网格中。 我正在使用基本的php mysql从数据库返回结果。 这是我的kendo javascript代码。

<script>
        $(document).ready(function () {
            $("#grid").kendoGrid({
                dataSource: {
                    // type: "json",
                    transport: {
                        read: {
                            url: 'que.php',
                            ContentType: 'application/json',
                            type: 'GET',
                            dataType: 'json'
                        }
                    },
                    schema: {
                        data: 'rows'
                    }
                    // pageSize: 20
                },
                height: 550,
                groupable: true,
                sortable: true,
                pageable: {
                    refresh: true,
                    pageSizes: true,
                    buttonCount: 5
                },
                columns: [{
                    field: "student_name",
                    title: "NAME",
                    width: 240
                }, {
                    field: "nic",
                    title: "NIC"
                }, {
                    field: "father_name",
                    title: "Father Name"
                }, {
                    field: "dob",
                    title: "DOB",
                    width: 150
                }]
            });
        });
    </script>

这是我的php mysql文件que.php。 我以json格式返回此文件。

    <?php
header('Content-Type: application/json');
include '../conn.php';
$query11 = "select student_name,nic,father_name,dob from student_info where program='diploma' and status='confirmed' order by batch,roll_no";
$run1 = mysql_query($query11);
$rows = array();
while($r = mysql_fetch_assoc($run1)){
    $rows[] = $r;
}
echo json_encode($rows, JSON_PRETTY_PRINT);
?>

请帮助我。 我是剑道网格的新手。 帮助将不胜感激。

我也在分享图片,以帮助您更好地理解。

这是我目前所拥有的

请指出我做错了什么。

我想到了。 只需删除所有空白和来自另一页的<br>标记。 然后从data: 'rows'删除行data: 'rows' 有效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM