괜찮 았어, 여기에 문제가있다 ... 나는이 jqGrid를 가지고 있고, 내가 필요로하는 것은 데이터를 보여 준 것이다.사용자 데이터를 jqGrid로 보내려면 어떻게해야합니까?
jQuery("#myGrid").jqGrid
{
url:'/loadGrid.php?q=2',
datatype: "xml",
colNames:[...],
colModel:[...],
// some other params.
footerrow : true,
**userDataOnFooter : true,** // it should show footer's custom information.
altRows : true
}).navGrid('#pagerGrid',{add:false,edit:false,del:false, search:false});
노호와 같이이있는 jqGrid는 정의를 가지고 있으며, loadGrid.php은 노호
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
// here goes connextion to database and data collection
...
//
if (stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml"))
{
header("Content-type: application/xhtml+xml;charset=utf-8");
}
else
{
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
echo "<page>$current</page>";
echo "<total>$total</total>";
echo "<records>$records</records>";
// and data population
foreach($data as $key => $value)
{
$ff = $value['field_1'];
echo "<row id='". $ff."'>";
// $ff = $value['field_1'];
echo "<cell> <![CDATA[" . $ff . "]]></cell>";
$ff = $value['field_2'];
echo "<cell> <![CDATA[" . $ff . "]]></cell>";
$ff = $value['field_3'];
echo "<cell> <![CDATA[" . $ff . "]]></cell>";
// ... and so on whith all column definitions.
echo "</row>";
}
echo "</rows>";
이 작동하지만 그리드를 표시 할 때 문제가 될 표시된 다음 구조를 가지고있다. 그리드 바닥 글에 빈 행만 표시됩니다. 일부 sumarized 데이터를 넣고 페이지에 보내려고하면 아무 것도 표시되지 않습니다. 그래서, 내가 알아야 할 것은 읽는 페이지의 userdata를 어떻게 전달해야 하는가입니다.
나는 이미 jqGrid 위키에서 정보를 읽었으며 과 같은 내용을 말했습니다. "userData :이 배열에는 요청의 사용자 정의 정보가 들어 있으며 언제든지 사용할 수 있습니다."하지만이 정보를 #myGrid에 전달하는 방법을 모르겠습니다. 누군가 그것에 대해 어떤 생각을 갖고 있습니까? 어떤 도움이라도 대단히 감사하겠습니다.
굉장 !! 고마워, 완벽하게 작동! – GummDev
@ user1031959 : 안녕하세요. 문제가 해결되면 대답을 [수락] (http://meta.stackexchange.com/q/5235/147495) 할 수 있습니다. – Oleg