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
Error "h is undefined" line 341 for subgrid
08/03/2010
06:22
Avatar
Ed Valentine
Member
Members
Forum Posts: 32
Member Since:
23/10/2009
sp_UserOfflineSmall Offline

I am trying to add the subgrid to a working grid. Firebug returns the error "h is undefined" at line 341 in the jqgrid.min.js file.

It is probibly me code but I can not find anything.

Suggestions?

08/03/2010
22:20
Avatar
bdensmore
Member
Members
Forum Posts: 11
Member Since:
21/01/2010
sp_UserOfflineSmall Offline

Have you tried looking at the data being returned to the grid? Could there possibly be an illegal character in that data? That is, if you're populating the grid with any data at this point.

It's possible that you have a single quote or something in some of your data and causes the javascript code to break.

I'm just guessing since you didn't post any code. But, if you are loading in data, maybe take a look at what's being returned.

Ben

09/03/2010
18:51
Avatar
Ed Valentine
Member
Members
Forum Posts: 32
Member Since:
23/10/2009
sp_UserOfflineSmall Offline

Returned data string: 

{"rows": [{"Cell": ["101", "2010-03-01", "10:19:08-06:00", "10:19:08-06:00"], "id": "1"}, {"Cell": ["101"

, "2010-03-01", "None", "None"], "id": "2"}, {"Cell": ["102", "2010-03-04", "14:32:12-06:00", "14:32

:12-06:00"], "id": "3"}]}

        jsonReader : {
          root: "rows",
          page: "page",
          total: "total",
          records: "records",
          repeatitems: true,
          cell: "cell",
          id: "id",
              subgrid: {
              root: "rows",
              repeatitems: true,
              cell: "cell",
              id: "id"
               }
          },


        hidegrid: false,
        hiddengrid: false,
        multiselect: false,
            subGrid : true,
            subGridUrl: 'time_subgrid.html',
            params: ['id'],
            subGridModel: [{ name : ['No','Date','Start','End'],
                 width : [55,100,80,80],
                 align : ['left','left','right','right']
                 } ],


JSON ["101", "2010-03-01", "10:19:08-06:00", "10:19:08-06:00"] as shown by Firebug.

These are the parts for the subgrid. The remander of the code is working. The code stops showing the 'Loading....." alert. After receiving the json load.

Any Suggestions?

Thanks.
09/03/2010
20:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello

you have jsonReader like this

jsonReader :

{ root: "rows",

page: "page",

total: "total",

records: "records",

repeatitems: true, 

cell: "cell",

id: "id",

....

I think it should be

jsonReader :

{ root: "rows",

page: "page",

total: "total",

records: "records",

repeatitems: true, 

cell: "Cell",

id: "id",

....

According to your response

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.

10/03/2010
20:18
Avatar
Ed Valentine
Member
Members
Forum Posts: 32
Member Since:
23/10/2009
sp_UserOfflineSmall Offline

Tony,

Thanks for your reply. I made the change and that did not help. If I set repeatItems: false, there is no error and no data in the grid. This is correct behavior.If I set to true then there is the error. This tells me that the issue is, I think, in json reader translating the data string.

Can you see anything in the data string that is wrong?

15/03/2010
20:20
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please post your grid configurations, or better provide a link?

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.

22/03/2010
18:41
Avatar
Ed Valentine
Member
Members
Forum Posts: 32
Member Since:
23/10/2009
sp_UserOfflineSmall Offline

Code from Firebug:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
4
5<head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Employee Grid </title><link rel="stylesheet" type="text/css" media="screen" href="css/redmond/jquery-ui-1.7.2.custom.css" /><link rel="stylesheet" type="text/css" media="screen" href="src/css/ui.jqgrid.css" /><link rel="stylesheet" type="text/css" media="screen" href="css/grid1.css" /><link rel="stylesheet" type="text/css" media="screen" href="css/jquery.searchFilter.css" /><script src="js/jquery-1.3.2.min.js" type="text/javascript"></script><script src="js/jquery-ui-1.7.2.custom.js" type="text/javascript"></script><script src="js/i18n/grid.locale-en.js" type="text/javascript"></script><script src="js/jquery.jqGrid.min.js" type="text/javascript"></script><script type="text/javascript">
7var lastsel
8jQuery(document).ready(function(){
9 jQuery("#list").jqGrid({
10 url:'emp_gd_data.html',
11 datatype: 'json',
12 jsonReader : {
13 root: "rows",
14 page: "page",
15 total: "total",
16 records: "records",
17 repeatitems: true,
18 cell: "cell",
19 id: "id",
20 subgrid: {
21 root: "rows",
22 repeatitems: true,
23 row: "Cell",
24 cell: '0',
25 id: "id"
26 }
27 },
28 mtype: 'GET',
29 colNames:['Emp Nm', 'Active','Last','First','SSN','City','State','Site_ID','id'],
30 colModel :[
31 {name:'Emp_nm', index:'emp_nm', width:80, align:'right', sorttype:'int',
32 search:true,searchoptions:{sopt:['eq']}},
33 {name:'item_nm', index:'item_nm', width:80, align:'right', sorttype:'int'},
34 {name:'seq', index:'seq', width:80, align:'right'},
35 {name:'action', index:'action', width:80, sortable:true, editable:true},
36 {name:'act_dt', index:'act_dt', width:80, sortable:true},
37 {name:'ckd_by', index:'ckd_by', width:75, sortable:true},
38 {name:'sent_to', index:'sent_to', width:100, sortable:true},
39 {name:'alert', index:'alert', width:300, sortable:true,search:true},
40 {name:'id', index:'id', width:80, align:'right', sorttype:'int'} ],
41 editurl: 'emp_dtl.html',
42 pager: jQuery('#pager'),
43 rowNum:10,
44 rowList:[10,20,30],
45 sortname: 'account',
46 sortorder: "desc",
47 viewrecords: true,
48 caption: 'Employees',
49 hidegrid: false,
50 hiddengrid: false,
51 multiselect: false,
52 subGrid : true,
53 subGridUrl: 'time_subgrid.html',
54 params: ['id'],
55 subGridModel: [{ name : ['No','Date','Start','End'],
56 width : [55,100,80,80],
57 align : ['left','left','right','right']
58 } ],
59 })
60});
61jQuery("#list").jqGrid('navGrid','#pager', { edit:true,add:false,del:false,search:true,refresh:true },
62 {}, // edit options
63 {}, // add options
64 {}, //del options
65 {multipleSearch:true} // search options
66 );
67<!-- }); -->
68$("#bedata").click(function(){
69 var gr = jQuery("#list").jqGrid('getGridParam','selrow');
70 if( gr != null ) jQuery("#list").jqGrid('viewGridRow',gr,{height:280,reloadAfterSubmit:false});
71 else alert("Please Select Row");
72});
73 </script><style type="text/css"></style>
74 <link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" />
75</head>

Responce as in Firebug:

{"rows": [{"Cell": ["101", "2010-03-01", "10:19:08-06:00", "10:19:08-06:00"], "id": "1"}, {"Cell": ["101"

, "2010-03-01", "None", "None"], "id": "2"}, {"Cell": ["102", "2010-03-04", "14:32:12-06:00", "14:32

:12-06:00"], "id": "3"}, {"Cell": ["102", "2010-03-10", "12:53:00-06:00", "22:24:00-06:00"], "id": "4"

}]}

http://www.prosoftplus.com:8088/emp_gd

Thanks for your help.
25/03/2010
09:13
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You will need to configure the jsonReader for the subgrid in the right way. They is little diffrent for the

Look here

http://www.trirand.com/jqgridw.....properties

Try

jsonReader : {
    root: "rows",
    page: "page",
    total: "total",
    records: "records",
    repeatitems: true,
    cell: "cell",
    id: "id",
    subgrid: { root: "rows", repeatitems: true, cell: 'Cell'}
}

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.

25/03/2010
22:03
Avatar
Ed Valentine
Member
Members
Forum Posts: 32
Member Since:
23/10/2009
sp_UserOfflineSmall Offline

That fixed it! Thanks.Smile

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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