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
How to display subgrid&
15/12/2008
05:55
Avatar
SergeyK
Member
Members
Forum Posts: 13
Member Since:
31/10/2008
sp_UserOfflineSmall Offline

when i pressed '+', there no any rows of subgrid

i think, that it hasn't entered to 'subgrid.php' at all.

What else should i wright to display subgrid?

jQuery('#list').jqGrid({
url:'DataSalary2.php?q=1',
datatype: 'json',
mtype: 'GET',
colNames:['Номер','Код'],
height: '100%',
colModel :[
{name:'Number',index:'Number', width:100, align:'center',search:true, jsonmap: 'Number'  , sorttype:'int'},
{name:'Code',index:'Code', width:100,align:'left', search:true, jsonmap: 'Code' ,sorttype:'text'}],
imgpath: 'themes/green/images',
jsonReader: {
                repeatitems: true,
                cell: 'cell',
              id: 'id'
            },
subGrid : true,
subGridUrl: 'subgrid.php',
subGridModel: [{ name  : ['Number','Name'],
                    width : [55,200],
     params:['Code']} ],
pager: jQuery('#pager'),
rowNum:10,
rowList:[10,20,30],
viewrecords: true,
sortname: 'Team'

16/12/2008
03:04
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Did you have respnse from the server when you click on the plus.

Also what data return the script in subgrid.php

Check your query for the subgrid.

Also look at the examples how to configure.

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.

16/12/2008
03:45
Avatar
SergeyK
Member
Members
Forum Posts: 13
Member Since:
31/10/2008
sp_UserOfflineSmall Offline

i haven't response from server. subgrid.php hasn't recived any data.

16/12/2008
04:23
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

In order to have something in the subgrid, you should configure

server.php to return the needed data. Read the docs how to do that.

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.

17/12/2008
03:26
Avatar
SergeyK
Member
Members
Forum Posts: 13
Member Since:
31/10/2008
sp_UserOfflineSmall Offline

Hi,tony

thanks, 

i recived data from subgrid.php, but it didn't displayed yet.

my subgrid.php

 $db = mysql_connect("localhost", "log", "pas")
 or die("Connection Error: " . mysql_error());
 mysql_select_db("base") or die("Error conecting to db.");

 $SQL = "SELECT Code,Number,Name FROM tabSub WHERE Code = '".$Code."'";
 $result = mysql_query( $SQL ) or die("Couldn't execute query.".mysql_error());

$responce->page = 1;
$responce->total = 1;
$responce->records = 1;
 $i=0;
 while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
     $responce->rows[$i]['id']=$row[Number];
     $responce->rows[$i]['cell']=array($row[Number],$row[Name]);
     $i++;
 }

echo $json_encode($responce);

 my main.php

<body>
<script type='text/javascript'>
<!--
jQuery(document).ready(function(){
jQuery('#list').jqGrid({
url:'DataSalary2.php?q=1',
datatype: 'json',
mtype: 'GET',
colNames:['Номер','Код'],
height: '100%',
colModel :[
{name:'Number',index:'Number', width:100, align:'center',search:true, jsonmap: 'Number'  , sorttype:'int'},
{name:'Code',index:'Code', width:100,align:'left', search:true, jsonmap: 'Code' ,sorttype:'text'}],
imgpath: 'themes/green/images',

rowNum:10,
rowList:[10,20,30],
viewrecords: true,
subGrid : true,
subGridUrl: 'subgrid.php?nd='+new Date().getTime(),
subGridModel: [{ name  : ['Number','Name'],
                    width : [55,200],
     params:['Code']} ],
pager: jQuery('#pager'),
caption: 'S'
}).navGrid('#pager',{edit:false,add:false,search:false,del:false});
});
//-->
</script>
<table id='list' class='scroll' cellpadding='0' cellspacing='0'></table>
<div id='pager' class='scroll' style='text-align:center;'></div>

</body>");

what is wrong?

17/12/2008
11:28
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

look at the demo page json subgrid. Maybe you miss here to obtain the parameter using $_GET -

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