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
Cannot get grid to render with xmlstring spring mvc controller
26/06/2012
22:36
Avatar
caztheconqueror
New Member
Members
Forum Posts: 2
Member Since:
26/06/2012
sp_UserOfflineSmall Offline

Hi

I have been struggling with JQgrid for three days. I have tried different data structures. I thought the easiest would be xmlstring. I am able to get the table header up but the rows are consistently empty.

Please help to tell me what I am doing wrong. I render the xml from a Spring mvc controller. I put it in the request and create a javascript var with the xml.

var xmlStr = "<%=request.getAttribute("source") %>";

        $(function(){
          $("#dvrList").jqGrid({
            datatype:'xmlstring',
            datastr:'xmlStr',
            autowidth: true,
            colNames:['Title','Recording Type', 'Recording Start Date','Recording End Date','Listed Start Time','Listed End Time','Recording Status','Delete Date', 'Status Before Delete', 'Delete Priority'],
               colModel :[
              {name:'Title',sortable:true},
              {name:'Recording Type'},
              {name:'Recording Start Date'},
              {name:'Recording End Date'},
              {name:'Listed Start Time'},
              {name:'Listed End Time'},
              {name:'Recording Status'},
              {name:'Delete Date'},
              {name:'Status Before Delete'},
              {name:'Delete Priority'}
            ],
            pager: '#dvrPager',
            rowNum:10,
            rowList:[10,20,30],
            sortname: 'Title',
            sortorder: 'desc',
            viewrecords: true,
            repeatitems:true,
            caption: 'Dvr Schedule',
        
          });
        });

My xml structure looks like the following.

<?xml version='1.0' encoding='utf-8'?>
<rows>
  <page>1</page>
  <total>1</total>
  <records>3</records>
  <rows>
      <row id="1">
        <cell>Bait Car 1</cell>
        <cell>Program</cell>
        <cell>1340416800000</cell>
        <cell>1340418600000</cell>
        <cell>1340416800000</cell>
        <cell>1340416800000</cell>
        <cell>PendingNoConflict</cell>
        <cell>0</cell>
        <cell>PendingNoConflict</cell>
        <cell>P3</cell>
      </row>
       <row id="2">
        <cell>Bait Car 2</cell>
        <cell>Program</cell>
        <cell>1340416800000</cell>
        <cell>1340418600000</cell>
        <cell>1340416800000</cell>
        <cell>1340416800000</cell>
        <cell>PendingNoConflict</cell>
        <cell>0</cell>
        <cell>PendingNoConflict</cell>
        <cell>P3</cell>
      </row>
       <row id="3">
        <cell>Bait Car 3</cell>
        <cell>Program</cell>
        <cell>1340416800000</cell>
        <cell>1340418600000</cell>
        <cell>1340416800000</cell>
        <cell>1340416800000</cell>
        <cell>PendingNoConflict</cell>
        <cell>0</cell>
        <cell>PendingNoConflict</cell>
        <cell>P3</cell>
      </row>
   </rows>

I have tried changing my data structures, I am reversing back to this way of doing it until I can render a table then I can do something more complex with json etc.  I have added the xmlreader then taken it out. I am not to sure if the colmodel is correct. What am I doing wrong?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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