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
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
}
}