Forum


05:55

31/10/2008

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'
03:04

Moderators
30/10/2007

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.
04:23

Moderators
30/10/2007

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.
03:26

31/10/2008

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

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66