EasyUI Forum
September 15, 2025, 07:40:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Missing first row in subgrid  (Read 12624 times)
MFS
Newbie
*
Posts: 47



View Profile
« on: March 14, 2016, 03:50:49 AM »

Hello there.
I have one problem.
I created grid with subgrid.
All i fine.I recive data for master grid, and when I click on + to display subgrid I also recive data but always is missing first row.
I checked in database and when I use same select statment in sql management studio I recive all item and first one also.
If I change ordering, same thing.Always missing first item...
Code:
	<script type="text/javascript">

$(function()
{
$('#grdSysKorisnik').datagrid(
{
view: detailview,
detailFormatter:function(index,row)
{
return '<div style="padding:2px"><table class="ddv"></table></div>';
},
onExpandRow: function(index,row)
{
var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
ddv.datagrid(
{
url:'dsrSysKorisnikDetalj.php?SysKorisnikIDX='+row.SysKorisnikID,
fitColumns:true,
singleSelect:true,
rownumbers:true,
loadMsg:'Učitavanje',
height:'auto',
columns:[[
{field:'NazivX',title:'Naziv',width:100},
{field:'DatumOtvaranjaX',title:'Datum otvaranja',width:100,align:'left'},
{field:'DatumKrajaX',title:'Datum kraja',width:100,align:'left'}
]],
onResize:function()
{
$('#grdSysKorisnik').datagrid('fixDetailRowHeight',index);
},
onLoadSuccess:function()
{
setTimeout(function()
{
$('#grdSysKorisnik').datagrid('fixDetailRowHeight',index);
},0);
}
});
$('#grdSysKorisnik').datagrid('fixDetailRowHeight',index);
}
});
});

</script>

Code:
							<table id="grdSysKorisnik" title="" class="easyui-datagrid" style="auto;height:600px"
url="dsrSysKorisnikMaster.php"
toolbar="#toolbar" pagination="true"
rownumbers="true" fitColumns="true" singleSelect="true" >

<thead>
<tr>
<th field="SysKorisnikID" width="5">Šifra</th>
<th field="ImeX" width="20">Ime</th>
<th field="PrezimeX" width="20">Prezime</th>
<th field="EMail" width="20">Email</th>
<th field="AktivanTekst" width="20">Aktivan</th>
</tr>
</thead>
</table>

Code:
<?php
include 
'Konekcija/Konekcija.php';


$SysKorisnikID $_REQUEST['SysKorisnikIDX'];

$parametri = array( 
                 array(
$SysKorisnikIDSQLSRV_PARAM_IN)
               );
$msqSysKorisnikSRadnaGrupa "{call SifEZ.spSysKorisnikSRadnaGrupa (?)}";
$msqSysKorisnikSRadnaGrupaPolja sqlsrv_query$konekcija$msqSysKorisnikSRadnaGrupa$parametri);
$row sqlsrv_fetch_array($msqSysKorisnikSRadnaGrupaPolja);

$items = array();
while($row sqlsrv_fetch_object($msqSysKorisnikSRadnaGrupaPolja))
{
array_push($items$row);
}
echo json_encode($items);
?>


When I exec this storage procedure SifEZ.spSysKorisnikSRadnaGrupa with param in sql I recive all data but there is no first row in subgrid.




NOTE: I double check php, java, params, storageprocedure and others, but only and always missing first row in subgrid but not in sql management studio.
If I have one result with params in sql, in subgrid there is no results.
Any idea?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: March 16, 2016, 09:03:56 AM »

Please open the browser's debug tool to see what data returned from 'dsrSysKorisnikDetalj.php'. Are there any errors while loading the data?
Logged
MFS
Newbie
*
Posts: 47



View Profile
« Reply #2 on: March 17, 2016, 02:01:30 AM »

Return ( browser debug tool FireBug):
[{"Naziv":"My Company","NazivX":"My Company","DatumOtvaranja":{"date":"2015-08-06 00:00:00","timezone_type":3,"timezone":"Europe\/Berlin"},"DatumOtvaranjaX":"08\/06\/2015","DatumKraja":null,"DatumKrajaX":null}]

But in SQL studio I recive two result.
Where is here second result??
Logged
battlezad
Newbie
*
Posts: 44


View Profile
« Reply #3 on: March 23, 2016, 06:22:30 AM »

that second row is fetching your first result? Why you have that?

$msqSysKorisnikSRadnaGrupaPolja = sqlsrv_query( $konekcija, $msqSysKorisnikSRadnaGrupa, $parametri);
$row = sqlsrv_fetch_array($msqSysKorisnikSRadnaGrupaPolja);
Logged
MFS
Newbie
*
Posts: 47



View Profile
« Reply #4 on: March 23, 2016, 06:28:51 AM »

that second row is fetching your first result? Why you have that?

$msqSysKorisnikSRadnaGrupaPolja = sqlsrv_query( $konekcija, $msqSysKorisnikSRadnaGrupa, $parametri);
$row = sqlsrv_fetch_array($msqSysKorisnikSRadnaGrupaPolja);

I do not understand your question. Can you be more specific?
Logged
battlezad
Newbie
*
Posts: 44


View Profile
« Reply #5 on: March 23, 2016, 06:31:40 AM »

/* Here you make query to your db and get two rows of data */
$msqSysKorisnikSRadnaGrupaPolja = sqlsrv_query( $konekcija, $msqSysKorisnikSRadnaGrupa, $parametri);

/* Here you read your first data, comment this line, it is not needed*/
$row = sqlsrv_fetch_array($msqSysKorisnikSRadnaGrupaPolja);
-->
//$row = sqlsrv_fetch_array($msqSysKorisnikSRadnaGrupaPolja);
   
   $items = array();
/* Here you read your second row data and push it in to array */
   while($row = sqlsrv_fetch_object($msqSysKorisnikSRadnaGrupaPolja))
   {
      array_push($items, $row);
   }
Logged
MFS
Newbie
*
Posts: 47



View Profile
« Reply #6 on: March 23, 2016, 06:38:45 AM »

/* Here you make query to your db and get two rows of data */
$msqSysKorisnikSRadnaGrupaPolja = sqlsrv_query( $konekcija, $msqSysKorisnikSRadnaGrupa, $parametri);

/* Here you read your first data, comment this line, it is not needed*/
$row = sqlsrv_fetch_array($msqSysKorisnikSRadnaGrupaPolja);
-->
//$row = sqlsrv_fetch_array($msqSysKorisnikSRadnaGrupaPolja);
   
   $items = array();
/* Here you read your second row data and push it in to array */
   while($row = sqlsrv_fetch_object($msqSysKorisnikSRadnaGrupaPolja))
   {
      array_push($items, $row);
   }


Its work.
There was a problem.
Thanks a lot.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!