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
Newbie: Problems Loading first grid
14/05/2010
23:52
Avatar
MikeJudd
Member
Members
Forum Posts: 4
Member Since:
14/05/2010
sp_UserOfflineSmall Offline

Hi all -

I'm new to jqGrid, and I'm trying to work through the example grid. When I run it, I get the caption, header, body, and navigation layers, but the body is empty. The "Loading ..." message flashes briefly, but nothing shows up, and I don't get any error messages.

My Javascript code is:

          jQuery("#list").jqGrid({
            url:MyURL,
            datatype: 'xml',
            mtype: 'GET',
            colNames:['Inv No','Amount','Tax','Notes'],
            colModel :[
              {name:'invid', index:'invid', width:55},
              {name:'amount', index:'amount', width:80, align:'right'},
              {name:'tax', index:'tax', width:80, align:'right'},
              {name:'note', index:'note', width:150, sortable:false}
            ],
            pager: '#pager',
            rowNum:10,
            rowList:[10,20,30],
            sortname: 'invid',
            sortorder: 'desc',
            viewrecords: true,
            caption: 'My first grid'
          });

and the XML that is returned is (this is when I just to a GET to the server and display the result:

 <?xml version='1.0' encoding='utf-8'?>
 <rows>
 <page>1</page>
 <total>1</total>
 <records>2</records>
 <row id='1'>
 <cell>101</cell>
 <cell>500.00</cell>
 <cell>15.00</cell>
 <cell>Testing</cell>
 </row>
 <row id='2'>
 <cell>102</cell>
 <cell>200.00</cell>
 <cell>10.00</cell>
 <cell>Testing2</cell>
 </row>
 </rows>

I assume I'm missing something obvious, but I've been working with it all afternoon and I just don't see it. Can anyone point me in the right direction?

Thanks very much,

17/05/2010
20:43
Avatar
MikeJudd
Member
Members
Forum Posts: 4
Member Since:
14/05/2010
sp_UserOfflineSmall Offline

Okay - I figured it out. After some JS debugging, I discovered that jqGrid was having a problem parsing the XML, and the problem was caused by the fact that I had a space before the first line (<?xml ....). After removing that space, it worked fine (except that the sort and "next page" don't seem to work .... onwards and upwards! 😉

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
50 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