Wijmo Flex Sheet Calculation update

Posted by: reeshabh.choudhary on 20 September 2019, 3:47 am EST

    • Post Options:
    • Link

    Posted 20 September 2019, 3:47 am EST

    In Earlier version, whenever I used to switch to right tab after putting values in current tab, the calculation used to get updated. After switching to new version, calculation update happens only after switching to bottom tab.

  • Posted 20 September 2019, 3:57 am EST

    please watch the operation video through link below:

    https://drive.google.com/open?id=1lLtyZW_7Uesk9oyY66JXufF9AsksdUMY

  • Posted 23 September 2019, 12:28 am EST - Updated 3 October 2022, 7:15 pm EST

    Hi,

    We are sorry but we were not able to replicate the issue at our end. Please refer to the sample below that we used to replicate the issue and the attached screenshot:

    https://stackblitz.com/edit/angular-kdvtqh

    Could you please modify the sample so that it replicates the issue? It would really help us to investigate further.

    Regards,

    Ashwin

  • Posted 23 September 2019, 2:27 am EST

    Regrding code implementations, following approach has been used, I can see value being updated in dataSource, but it does not get updated on screen. It reflects only after switching 4 or 5 right tabs however, reflects immediately after switching a tab below.

    
    onFlexSheetInit(flexSheet) {
    	const self = this;
        	flexSheet.deferUpdate(() => {
    	flexSheet.itemsSource = metricDataObj.dataSource;
    	flexSheet.itemFormatter = function (panel, r, c, cell) {
    	self.handleCalculatedFields(metricDataObj.dataSource, r, c, cell);
    }}
    }
    

    and in HandleCalculatedFields:

    
    dataSource[row - 1].values[col - 1].fieldValue = calculatedValue;
    
    
  • Posted 24 September 2019, 1:58 am EST

    Hi Reeshabh,

    This issue is arising because of how the itemFormatter runs. When we move to the right cell, the formatter only runs for one time and then the cellEditEnded event is raised. Due to this, when the formatter runs for the calculated, the edited cell value is not updated and therefore the calculated field is also not updated.

    But, when we move to the cell below, the itemFormatter runs twice, once before the cellEditEnded event is raised and once after it. Therefore the value gets updated.

    To update the cell value after editing, I would recommend you use the cellEditEnding event. Please refer to the sample below demonstrating the same:

    https://stackblitz.com/edit/angular-9qmat1

    ~regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels