|
Title: Missing first row in subgrid Post by: MFS 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"> Code: <table id="grdSysKorisnik" title="" class="easyui-datagrid" style="auto;height:600px" Code: <?php When I exec this storage procedure SifEZ.spSysKorisnikSRadnaGrupa with param in sql I recive all data but there is no first row in subgrid. (http://s8.postimg.org/f1o5dp4h1/XCapture.png) (http://s10.postimg.org/5jw967nft/XXCapture.png) 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? Title: Re: Missing first row in subgrid Post by: jarry 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?
Title: Re: Missing first row in subgrid Post by: MFS 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?? Title: Re: Missing first row in subgrid Post by: battlezad 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); Title: Re: Missing first row in subgrid Post by: MFS 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? Title: Re: Missing first row in subgrid Post by: battlezad 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); } Title: Re: Missing first row in subgrid Post by: MFS 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. |