EasyUI Forum
May 01, 2024, 10:35:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: eDatagrid not showing all added records after addRow  (Read 3713 times)
Spike
Newbie
*
Posts: 22


View Profile
« on: March 18, 2015, 04:21:41 AM »

Hello,

I have a eDatagrid and add a selected group of records from another eDatagrid in the same Window.
Everthing is okay and all records are inserted into de MYSQL table but the reload off the inserted eDatagrid is manytimes not Cry showing all the records.

Mainly the last record is not shown in the Grid (see my code below)

When I do afterwards manually a refresh all records are shown.  
Has it something to do with JSON?  Or is it a Bug?

What am I doing wrong?  Can you give me a solution for this?

Thanks in advance!

Spike


function get_selections_from_grid(){

var hvs_prestatienr          = [];
var hvs_prestatieomschrijving    = [];
var hvs_prestatieverkoopprijs    = [];

var hvs_counter;   
var hvs_totaal_aantal_regels;
   
   hvs_counter=0;
   
   var rows = $('#dg_client1').datagrid('getSelections');

   hvs_totaal_aantal_regels = rows.length;
   
   for(var i=0;i<rows.length;i++){
      hvs_prestatienr.push(rows.prestatienr);
      hvs_prestatieomschrijving.push(rows.prestatieomschrijving);
      hvs_prestatieverkoopprijs.push(rows.prestatieverkoopprijs);
   }   
      
   for(var i=0;i<rows.length;i++){   
      $('#dg_hvs').edatagrid('addRow',{
      row:{
         dossiernummer   : row22.id,
         tax          : row22.tax_tarief,
         zoeknaam      : row22.zoeknaam,
         prestatieomschrijving : hvs_prestatieomschrijving,
         prestatieverkoopprijs : hvs_prestatieverkoopprijs
         }
      }).edatagrid('saveRow');  

      hvs_counter=hvs_counter+1;  // COUNTING SAVED ROWS
   }    

   
   if ( hvs_counter == hvs_totaal_aantal_regels ) {
      $.messager.alert(' ALLE PRESTATIES ', 'GRID EN TOEGEVOEGD AAN FACTURATIE');
      $('#dg_hvs').edatagrid('reload');  // THIS GOES TO EARLY I MISS SOMETIME RECORDS IN THE GRID
   }



}
« Last Edit: March 18, 2015, 08:04:00 AM by Spike » 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!