0

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, 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

Oleg
  • 220,925
  • 34
  • 403
  • 798
Jayaprakash
  • 235
  • 1
  • 7
  • 13

1 Answers1

0

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).

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thanks Oleg for the response. I will checkout your links. deliveryJqgirdData.jsp itself does not have any html code. But I am using tiles that wraps additional content. I am trying to figure out how to ask Tiles to remove html content from this page though for other pages, it continues to add them. Thanks again! – Jayaprakash Dec 03 '10 at 11:52
  • @Jayaprakash: If you use jsp on the server part my links will probably you not really help. You should search for example how to implement web service which returns pure XML or better JSON data with respect of JSP technology which you use. – Oleg Dec 03 '10 at 11:55
  • Thanks Oleg. Yes, for this search purpose, it makes sense to make a webservice call. i will look in to your examples and see how to perform them. Thanks! again – Jayaprakash Dec 03 '10 at 12:44