Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Data not displayed on IE and Chrome (firefox Ok)
11/11/2009
06:25
Avatar
jmiguel.rodriguez
New Member
Members
Forum Posts: 2
Member Since:
11/11/2009
sp_UserOfflineSmall Offline

Hello all, 

Althoght I'm a long time java programmer, I've just started with javascript, jquery and jqgrid. 

I'm trying to implement jqgrid in one application and I'm having some problems. Sure it will be an stupidity but I've been some days trying to find by myself what's happening and cannot find it.

This is my first grid (code below).  Html page loads ok, and in firefox everything works fine, but not in IExplorer neither GoogleChrome. In IE/chrome I get the jqgrid correctly displayed but is not filled with data. I see the call to server (java servlet) in my logs and the xml output data is served back to jqgrid/jquery, but never displayed. 

I've tried to server the xml with different content types (I guess it must be "Content-type: text/xml;charset=utf-8" , or, in my case ISO-8859-15) but I've also tried with text/html without success. 

The error I see in IExplorer (v6 and v8) is an 'Object required' in jquery-1.3.2.min.js line 12 char 7209 , and in that point I see:

 return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)

The code: html/javascript:

-----------------------------------------------------------------------------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

        "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>jqGrid test</title>

<link rel="stylesheet" type="text/css" media="screen" href="/scanciax/css/cupertino/jquery-ui-1.7.2.custom.css" />

<link rel="stylesheet" type="text/css" media="screen" href="/scanciax/css/ui.jqgrid.css" />

<script src="/scanciax/js/jquery-1.3.2.min.js" type="text/javascript"></script>

<script src="/scanciax/js/i18n/grid.locale-sp.js" type="text/javascript"></script>

<script src="/scanciax/js/jquery.jqGrid.min.js" type="text/javascript"></script>

<script type="text/javascript">

jQuery().ready(function(){

  jQuery("#list").jqGrid({

    url:'/scanciax/servlet/lwasScancia?vsPage=jqdataPersonas',

    datatype: "xml",

    mtype: 'GET',

    colNames:['id','Nombre','Apellido 1', 'Apellido 2', 'Tratamiento'],

    colModel :[

      {name:'idpersona', index:'idpersona', width:1,hidden:true},

      {name:'snombre', index:'snombre', width:155, align:'left' , sortable:true},

      {name:'sapellido1', index:'sapellido1', width:90, align:'right', sortable:true},

      {name:'sapellido2', index:'sapellido2', width:380, align:'right', sortable:true},

      {name:'idtratamiento', index:'idtratamiento', width:10, align:'right', sortable:false }

 ],

    pager: jQuery('#pager'),

    rowNum:10,

    rowList:[10,20,50,100,250,500],

    sortname: 'sapellido1',

    sortorder: "asc",

    imgpath: 'themes/basic/images',

    caption: 'My test grid'

  });

});

</script>

</head>

<body>

<table width="100%" id="list" class="scroll"></table>

<div id="pager" class="scroll" style="text-align:center;"></div>

</body>

</html>

-----------------------------------------------------------------------------------------------------------------------------

Sample XML data served by the url "/scanciax/servlet/lwasScancia?vsPage=jqdataPersonas" is as follows:

-----------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="ISO-8859-15"?>

<rows>

  <page>1</page>

  <total>363</total>

  <records>3621</records>

  <row id="3047">

    <cell>3047</cell>

    <cell>PAUL</cell>

    <cell>- OTTO FASSBENDER</cell>

    <cell></cell>

    <cell>-1</cell>

  </row>

  <row id="2693">

    <cell>2693</cell>

    <cell>SERVICIO</cell>

    <cell>A</cell>

    <cell></cell>

    <cell>-1</cell>

  </row>

.......
</rows>
-----------------------------------------------------------------------------------------------------------------------
Any help will be highly appreciated. Thank you in advanced . 
12/11/2009
10:47
Avatar
jmiguel.rodriguez
New Member
Members
Forum Posts: 2
Member Since:
11/11/2009
sp_UserOfflineSmall Offline

I reply yo myself as I've just find what (stupid of me, I knew) was wrong:

I was setting Content-type on xml data from server as 'Content-type: text/xml', no just 'text/xml' as I should. The great thing is firefox doesn't complained about it.

Thank you all anyway

09/01/2010
02:37
Avatar
Jeff N.
Guest
Guests

I'm having the exact same problem as you and I don't quite understand how you fixed the xml error.  My code for my php code that builds the XML data looks like:

        . . .

        // we should set the appropriate header information
        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");
        }
       
        echo "<?xml version='1.0' encoding='utf-8'?>";
        echo "<rows>";
        echo "<page>".$page."</page>";
        echo "<total>".$total_pages."</total>";
        echo "<records>".$rowCt."</records>";

        foreach ($result as $row)
        {
            echo "<row id='".$row->PART_ID."'>"; 
            echo "<cell><![CDATA[".$row->PART_ID."]]></cell>";
            echo "<cell><![CDATA[".$row->EAU."]]></cell>";
            echo "<cell><![CDATA[".$row->MINPER."]]></cell>";
            echo "<cell><![CDATA[".$row->NOTIFY."]]></cell>";
            echo "<cell><![CDATA[".$row->STATUS."]]></cell>";           
            echo "</row>";
         }
   
        echo "</rows>";

        . . .

Do you have any suggestions?

09/01/2010
10:38
Avatar
olaf
GRENOBLE (FRANCE)
Member
Members
Forum Posts: 27
Member Since:
08/01/2010
sp_UserOfflineSmall Offline

I would write : pager: '#pager'

and not : pager: jQuery('#pager')

11/01/2010
18:36
Avatar
Jeff N.
Guest
Guests

olaf said:

I would write : pager: '#pager'

and not : pager: jQuery('#pager')


Are you talking about my code or the post above?  Are there any ideas out there for the IE error?  Things work great in firefox.

13/01/2010
18:19
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Jeff, What does not work exactley for you?

Best regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information