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
jqgrid not working
Tags: jqgrid
07/10/2012
01:53
Avatar
loka
Member
Members
Forum Posts: 4
Member Since:
07/10/2012
sp_UserOfflineSmall Offline

I just try jqgrid today but i have problems with my first try.

I follow one simple exemple (jqgrid_demo40/37array.html) and made a file :

<!DOCTYPE HTML>
<html>

<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" type="text/css" media="screen" href="./css/ui.jqgrid.css" />

<script src="./js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
<script src="./js/jquery.jqGrid.min.js"></script>
<script src="./js/i18n/grid.locale-en.js" type="text/javascript"></script>

<script type="text/javascript">
var mydata = [
              {id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"} ,
              {id:"2",invdate:"2010-05-25",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
              {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
              {id:"4",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
              {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
              {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
              {id:"7",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
              {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"21.00",total:"320.00"},
              {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
              {id:"11",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
              {id:"12",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
              {id:"13",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
              {id:"14",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
              {id:"15",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
              {id:"16",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
              {id:"17",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
              {id:"18",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
              {id:"19",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
              {id:"21",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
              {id:"22",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
              {id:"23",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
              {id:"24",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
              {id:"25",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
              {id:"26",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
              {id:"27",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
              {id:"28",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
              {id:"29",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
          ];
      jQuery("#list47").jqGrid({
          data: mydata,
          datatype: "local",
          height: 150,
          rowNum: 10,
          rowList: [10,20,30],
             colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
             colModel:[
                 {name:'id',index:'id', width:60, sorttype:"int"},
                 {name:'invdate',index:'invdate', width:90, sorttype:"date", formatter:"date"},
                 {name:'name',index:'name', width:100},
                 {name:'amount',index:'amount', width:80, align:"right",sorttype:"float", formatter:"number"},
                 {name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},        
                 {name:'total',index:'total', width:80,align:"right",sorttype:"float"},        
                 {name:'note',index:'note', width:150, sortable:false}        
             ],
             pager: "#plist47",
             viewrecords: true,
             caption: "Manipulating Array Data"
      });

</script>
</head>
<body>
    <table id="list47"></table>
    <div id="plist47"></div>
</body>
</html>

I have no problem to access all js and css files (link in view code source on page works) but nothing appear in my page.

I don't understand what i missed, if you could explain to me.

Thanks

08/10/2012
16:57
Avatar
loka
Member
Members
Forum Posts: 4
Member Since:
07/10/2012
sp_UserOfflineSmall Offline

No one to help me ?

If anyone have a single complete script to post that work without db (juste plain data), i could be able to understand.

Thanks

11/10/2012
17:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

It seems to me you missed a

jQuery(document).ready(function(){

// here your code

});

when you try to run the grid.

I recommend you to learn the documenataion and moreover how to use a jQuery scripts.

Regards

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.

11/10/2012
19:57
Avatar
loka
Member
Members
Forum Posts: 4
Member Since:
07/10/2012
sp_UserOfflineSmall Offline

Wow, such i'm such an idiot to not see THAT !

Thanks for the answer, i''l try again with my brain this time -_-'

11/10/2012
21:11
Avatar
loka
Member
Members
Forum Posts: 4
Member Since:
07/10/2012
sp_UserOfflineSmall Offline

Just to say : It works !

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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