0
작성한 jqGrid 내에 데이터베이스의 데이터를 필사적으로 표시하려고했지만 필자는 실제로 어떻게 작동하는지 이해하지 못합니다.jqGrid에 데이터베이스 테이블 표시
나는 jqGrid에 대한 문서를 철저히 읽고 공식 웹 사이트의 데모를 적용하려했지만 그리드의 "데이터"옵션을 PHP/MySQL 또는 AJAX 스크립트로 바꾸는 간단한 방법을 찾을 수 없습니다. 여기 내 코드는 다음과 같습니다.
<script>
$(function(){
$("#grid").jqGrid({
colNames: ["ID", "Context", "IP", "Community", "Modèle", "Uptime", "Version Soft", "Version Patch", "Date d'ajout", "Date modif", "Refresh"],
colModel: [
{name:'id', index:'id', width:60, sorttype:'int', align:'center'},
{name:'context', index:'context', width:130, align:'center'},
{name:'ip', index:'ip', width:150, align:'center'},
{name:'community', index:'community', width:100, align:'center'},
{name:'modele', index:'modele', width:80, align:'center'},
{name:'uptime', index:'uptime', width:150, align:'center'},
{name:'soft', index:'soft', width:150, align:'center'},
{name:'patch', index:'patch', width:150, align:'center'},
{name:'ajout', index:'ajout', width:100, sorttype:'date', align:'center'},
{name:'modif', index:'modif', width:100, sorttype:'date', align:'center'},
{name:'refresh', index:'refresh', width:70, align:'center', formatter:refresh_Button}
],
data: [
{id:"1",context:"LAB",ip:"192.168.xx.xx",community:"public",modele:"S57",ajout:"20-11-2017"}
],
caption: "Equipements disponibles :",
sortname: 'id',
sortorder:"desc",
rowNum:20,
rowList:[20,40,60],
pager:'#yolo'
});
function refresh_Button(cellvalue, options, rowobject){
return '<button type="button" onclick="">Go</button>';
}
});
</script>
</head>
<body>
<table id="grid"></table>
<div id="yolo"></div>
</body>
</html>
누구든지 이런 식으로 할 줄 알아요? 경우 사람들이 답을 알고 싶어 그냥에서