Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1934
sorting a formula column
posted

Hi,

I have an issue which causes the UI to lock up until *all* formulas are calculated for every row in the grid.  Deferred calculations are false because I need all formulas to be calculated so I can perform other operations.

To nail down the issue I hooked in to the after cell update event and printed the row number of the updated cell only if it was in a formula column.  I have approximately 150 formula columns in my grid which has about 2500 rows.  I bind the grid and display all formula columns and instantly see the console being written out with row numbers sequentially (ie a bunch of 1s, a bunch of 2s, etc).

If I then click a formula column header to sort it I see the sequence keeps going, the grid is still calculating all formulas in each row.  During this time the UI is also locked up because I suspect that the grid is waiting for all values in the sorted column to be calculated.  This won't happen until all formulas in the entire grid have been calculated based on the output I see in the console.

I would expect there would be some kind of optimization where the grid would calculate only values in that column so it could sort and then it would resume calculating the rest of the formulas where it left off.  If this behavior isn't possibly via some kind of setting is there anyway I can utilize the internal methods of the UltraCalcManager?

I've looked over the source code and think I could make it work but I wanted to know if it is even possible to do what I describe before I jump down that rabbit hole.

Thanks,

Boyd

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Boyd,

    In order to sort on a formula-result column, the grid has to wait until every formula in that column is calculated, obviously. The CalcManager builds a network of calculations and it has a dependency tree that ensures that calculations which depend on other calculations are calculated first. But there's no way for the CalcManager to know about a particular grid column and re-arrange it's dependency tree to calculate that column first. Which column is calculated first is basically arbitrary. All the grid can do is tell the Calculation network to keep calculating until the column it needs has finished calculating.

Children