Ask The Experts
In August 2020, we are providing a free service to the wider developer community, in which our Grid Gurus team will answer DataGrid-related questions.
Please email Adaptable Tools Support with your question and we guarantee to send a full and personalised response within 48 hours.
We have received a huge number of questions, and so we decided to display here some of those which we thought might be of general interest or benefit.
General Data Grid Questions
What is the best DataGrid on the market
This is perhaps the most common question we receive and the only one we wont answer!
There are plenty of excellent DataGrids to choose from and each offer different benefits.
Having said that, its only fair to add that the overwhelming majority of AdapTable users combine it with AG Grid, and the feedback we receive is that they are really happy with that DataGrid.
From our perspective, when using AG Grid (which all the demos on this site do), we can readily see why it has such overwhelming market share.
Should we filter on the Server or the Client?
The short answer is that depends entirely on your requirements and is not something we can answer without knowing more about your particular use case.
But, as general advice: only do server searching and filtering if you really have to.
We are consulted by plently of clients who only have 100,000 (or fewer) rows in their dataset and yet made the decision to do server searching, with all the additional complexity that brings.
In our view that is mistaken; modern browsers are capable of easily managing datasets of that size and performing instantaneous filtering and sorting.
By all means, do use the server if you have to, but we would advise you first to check if you can do everything you need on the server, and only if you cannot then to enable server filtering.
AG Grid Questions
We set enableValue to 'false' for a column but it still displays an aggregated value when grouping - we assumed setting this property would remove it?
That is expected AG Grid behaviour: enableValue (and enablePivot for pivoting and enableRowGroup for grouping) are UI instructions.
This means that if these are set to 'false', the User cannot change the behaviour at run-time (i.e. in your case, create a new aggregation or drop it into the 'Values' section in the Column sidebar).
However if the column's ColDef definition has the 'aggFunc' property already set (which we assume yours does) then it will still display that aggregated value in grouped rows.
How do we always make the column menu icon appear?
Set the suppressMenuHide property in GridOptions to true.
Is it possible to show aggregated totals at the top of a group?
Yes, you need to create a pinned row at the top of the grid and then each time the model's data updates, you should set that pinned row with the aggData from the model's root node
As it happens AdapTable can wrap this functionality for you via the showGroupingTotalsAsHeader option property (as you can see in this demo).
Should we use Master / Detail or Tree View?
In our view it depends on your data structure. If the 'sub' rows are naturally related to the Master then a Tree View is best e.g. for showing directories and containing files, or a company structure
If they are linked conceptually but not intrinsically in your data set then Master / Detail is more suitable.
Be aware when making your choice, that a Tree View has additional restrictions, e.g. row groping are pivoting are not available.