jqGrid displays columns, retrieves data but does not display the data
My jqGrid, displays columns, retrieves the data but it does not display them in the grid. Tiles is adding, header, footer and left panel layout (head, body, style tags etc.) in the data retrieved by jqGrid. Could that be the problem? If so, how can I avoid it? If I dont include deliveryJqgridData in Tiles definitions, Tiles does not forward the data to view page for rendering.
My Jqgrid definition:
$(function(){
$("#deliveryJqgrid").jqGrid({
url:'deliveryJqgridData',
datatype: 'xml',
mtype: 'GET',
colNames:['Col1','Col2', 'Col3','Col4','Col5'],
colModel :[
{name:'Col1', index:'Col1', width:55},
{name:'Col2', index:'Col2', width:90},
{name:'Col3', index:'Col3', width:80, align:'left'},
{name:'Col4', index:'Col4', width:80,开发者_JAVA百科 align:'left'},
{name:'Col5', index:'Col5', width:150, sortable:false}
],
pager: '#deliveryJqgridPager',
rowNum:10,
rowList:[10,20,30],
sortname: 'Col1',
sortorder: 'asc',
viewrecords: true,
caption: 'Delivery List - JQ Grid'
});
Firebug shows the following data was retrieved under "Net > GET deliveryJqgridData?_search=false > Response" tab. The Response output is stored at the following google docs link: DeliveryJqGridData.txt. Thanks in advance for your help
The contain of the server response DeliveryJqGridData.txt which you posted shows that the server return bad data. Instead of pure data like
<rows>
<page>1</page>
<total>1</total>
<records>5</records>
<row id='31'>
<cell>2</cell>
<cell>2</cell>
<cell>11</cell>
<cell>Description 1</cell>
<cell>11</cell>
</row>
...
</rows>
one find before the data two lines
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
(where the second line is wrong) and all the data are placed in a HTML page (???!!!). So you have to fix the problem on the server part which you not posted in your question. The server component deliveryJqgridData
must return pure XML or JSON data. You can use for example WFC or ASMX web service as a part of you seb site (see this and this answer for the code exampels and additional links).
精彩评论