Grid footer with sum working unexpectadly


#1

I am using version 7.3 and there are still issues with sum in formatted columns.

The code to generate the grid is as below:

var faktury_grid = new dhx.Grid(null, {
        columns: [
            { id: 'nr_fv', header: [{text: "Numer"}], align: 'left', minWidth: 200,type: 'string', sortable: false, footer: [{text: "Razem", align: 'right'}]},
            {
                id: 'kwota_netto',
                header: [{text: "Kwota netto", align: 'right'}],
                align: 'right',
                width: 100,
                type: 'number',
                sortable: false,
                footer: [{content: 'sum', align: 'right'}],
                format: "# #,00"
            },
            {
                id: 'kwota_brutto',
                header: [{text: "Kwota brutto", align: 'right'}],
                align: 'right',
                width: 100,
                type: 'number',
                sortable: false,
                footer: [{content: 'sum', align: 'right'}],
                format: "# #,00"
            },

            { id: 'zaplacona', header: [{ text: '<i class="fas fa-money-bill-alt"></i>', align: 'center'}], align: 'center', width: 50, sortable: false, htmlEnable: true},
        ],
            autoWidth:true,
            height: '100%'
    });
    local_layout.cell('faktury_content').attach(faktury_grid);
    faktury_grid.data.load('./data/customerinvs/' + rId);

#2

Unfortunately I was not able to reconstruct your problem.
The following snippet seems to work correctly:
https://snippet.dhtmlx.com/hi8m7hj1
If the problem still occurs for you please, provide a complete demo or a demo link, where the problem can be reconstructed.


#3

After further investigation it appears that the issue exists only on Safari (MacOS - I don’t have Windows to test) and it does not happen to appear every time.

Here is the test site: https://dev.blesksoft.pl/management-tools/test.html

Refreshing it couple of times gives me incorrect values in footer.


#4

This is some timing problem, that I was not able to reconstruct implementing your app locally.
Please, try to update your dhx.Suite sources to the latest build.
Also, you may try to load the data to your grid after the grid finally renders in the layout cell with the help of the awaitRedraw helper.
https://docs.dhtmlx.com/suite/helpers/await_redraw/
Like:

local_layout.cell('faktury_content').attach(faktury_grid);
dhx.awaitRedraw().then(function(){
   faktury_grid.data.load('./test/index');
})

instead of:

local_layout.cell('faktury_content').attach(faktury_grid);
faktury_grid.data.load('./test/index');

#5

It didn’t solve the issue. It’s still the same. I noticed that it only happens when grid’s height is smaller than part cell’s height. When the grid fills the entire cell from top to bottom it works perfectly fine. Maybe it’ll help.