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_Related Related Topics sp_TopicIcon
Am not getting basic data array to work
24/04/2010
21:52
Avatar
DadOnRed
Member
Members
Forum Posts: 3
Member Since:
24/04/2010
sp_UserOfflineSmall Offline

I am having problems getting data array to work based on what I've read in the example and in this forum. I must be missing something basic. My symptom is that nothing is appearing in the web browser when I load the page. I appreciate any help here.

Here is what I currently have (excerpted). All the xml and files are in the same directory as the .html file:

<html>

<head>

<link rel="stylesheet" type="text/css" media="screen" href="./jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="./ui.jqgrid.css" />
<script src="./grid.locale-en.js" type="text/javascript"></script>
<script src="./jquery.jqGrid.min.js" type="text/javascript"></script>
 <script type="text/javascript">   
 jQuery(document).ready(function(){
    jQuery("#list4″).jqGrid({
            datatype: "local",
            height: 250,
            colNames:['Backup No','Date', 'Size', 'Direction','Elapsed Time','Completed?','Notes'],
            colModel:[
                    {name:'id',index:'id', width:60, sorttype:"int"},
                    {name:'bkupdate',index:'bkupdate', width:90, sorttype:"date"},
                    {name:'size',index:'size', width:60},
                    {name:'direction',index:'direction', width:150, align:"left",sorttype:"float"},
                    {name:'dur',index:'dur', width:80, align:"right",sorttype:"float"},
                    {name:'succ',index:'succ', width:30,align:"right",sorttype:"float"},
                    {name:'note',index:'note', width:150, sortable:false}
             ],
             pager: jQuery('#pager'),
             rowNum:10,
             viewrecords: true,
             multiselect: true,
             caption: "Offsite Data Transfer Log Summary"
     });
      var mydata = [
                          {id:"1",bkupdate:"2010-04-30",size:"12GB",direction:"LAN to DC1",dur:"450",succ:"Y",note:"note"},
                          {id:"2",bkupdate:"2010-04-29",size:"12GB",direction:"LAN to DC1",dur:"430",succ:"Y",note:"note2"},
                        {id:"3",bkupdate:"2010-04-28",size:"11GB",direction:"LAN to DC1",dur:"420",succ:"Y",note:"note3"},
                        {id:"4",bkupdate:"2010-04-27",size:"11GB",direction:"LAN to DC2",dur:"425",succ:"Y",note:"note"},
                        {id:"5",bkupdate:"2010-04-26",size:"10GB",direction:"LAN to DC1",dur:"410",succ:"Y",note:"note2"},
                        {id:"6",bkupdate:"2010-04-25",size:"10GB",direction:"LAN to DC1",dur:"400",succ:"Y",note:"note3"},
                        {id:"7",bkupdate:"2010-04-24",size:"9GB",direction:"LAN to DC1",dur:"390",succ:"Y",note:"note"},
                        {id:"8",bkupdate:"2010-04-23",name:"9GB",direction:"LAN to DC1",dur:"380",succ:"Y",note:"note2"},
                        {id:"9",bkupdate:"2010-04-22",name:"8GB",direction:"LAN to DC1",dur:"375",succ:"Y",note:"note3"}
                   ];
      for(var i=0;i<=mydata.length;i++)
                  jQuery("#list4″).addRowData(i+1,mydata[i]);
  });
 </script>
</head>

<body>

 <table id="list4"></table>

</body>

</html>

[Image Can Not Be Found]
[Image Can Not Be Found]
26/04/2010
15:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Seems that everthing is ok. Could you please remove this from grid option:

pager: jQuery('#pager'),

The pager is not defined, but you point to it.

Do you have any error when you run this script?

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.

26/04/2010
20:26
Avatar
DadOnRed
Member
Members
Forum Posts: 3
Member Since:
24/04/2010
sp_UserOfflineSmall Offline

Tony, thanks for reading. I removed that line and the next two, i.e., :

             pager: jQuery('#pager'),
             rowNum:10,
             viewrecords: true,

but it still will not run for me (won't display anything).

02/05/2010
14:45
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I'm not sure, but if you set to use the new API, you will need to do it so:

for(var i=0;i<=mydata.length;i++)
    jQuery("#list4″).jqGrid('addRowData',i+1,mydata[i]);

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:
11 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