I've got a wxGrid that I populate dynamically. I'd like to store some information with each row that shouldn't be displayed to the user. What is the best way to associate data with a row? Should I just create a hidden column or is there a better way?
Creating a hidden column is the fastest, but indeed a very ugly method. If you can justify the effort, then you should better create your own grid table base class. Your own wxGridTableBase-derived class can hold any information you need it to, without the need to show it in the grid. Unfortunately the documentation for that class is sparse or nearly non-existent.
For an example see the grid demo in the wxWidgets samples directory, specifically the BugsGridTable class. What you will notice is that you do not necessarily store the strings that the grid will display, but you can format your data in the GetValue() method. This can be a lot better, both in terms of memory consumption, and because you can change the format of displayed data on-the-fly.
The switch to a custom grid table base class has had a big impact on speed, memory consumption and functionality for the result set data grid of FlameRobin, an administration tool for the Firebird relational database. You can always check out its source code for how we use wxGrid.
Store the value in the row label using SetRowLabelValue and hide the row labels.
Related
I am trying to have a table like view for my component, however I don't want to use the table component. Since, the table will save the data as html with tags and its difficult for me to read the data inside the rows. Traversing through or and so on.
If not, I was thinking to have a multifield component, which has one set header (for table header row) and the rest of the fields below will be mutlifield, we can keep adding as many rows as we want.
At present, i have something like
Name - value
Path - value
Type - value
The above entire thing is one value in the mutltifield. I can add multiple fields like the above.
but the ui looks clunky if we do it this way. I'd rather have a table like format.
if anyone has any suggestions I'm open to them.
Thanks
Your best bet will be to use CSS to override the look and feel for your custom multi-field and AEM's multi-field management UI.
You can probably make it look and feel like a fluent grid by changing the spacing between the edit fields and dimming the borders.
Making one monolithic custom extension to look and feel like a grid/table will be too complex and introduces the risk of deviating from node structure so I won't recommend that unless you are planning to take over the component's properties dialogues in authoring mode.
In my project, I need to display list of some data using QML List view.And, the QT version I am using is QT 5.0.2. Since, scroll bar view is not available in this version of Qt, I managed to implement it by following this example.
Now, the data source is an other component which has provided C++ APIs to request for range of data. And the number of elements in the data set can be huge (in terms of tens of thousands).
I have followed below steps to achieve my requirements :
I have a created a C++ class that inherits from QAbstractListModel and I have overridden rowCount, data, canfetchmore and fetch more functions.
And in the QML, I have referred the instance C++ as model.
Whenever fetchmore() function is called, I am requesting next set of data using C++ APIs that are provided by another component and appending the same to my list model.
So far, it is good. But I need few clarifications -
If I keep appending the data to my list model,then I will end up storing thousands of elements in the list (I don't want to do that). I want to limit the number of elements in the list and use it as a ring buffer. Is this possible?
QModelIndex parameter in fetchmore is received as invalid Index. Why?
Assume a case : alphabets are mentioned on scrollbar, and when user selects Y on scrollbar, I should fetch elements that starts with Y. Here, I can fetch the data from my external component and reset the list model with new data. But, if I do that,then my list will start with Y-elements and I will not be able to scroll up to get previous elements. -- Is there any other way to achieve this?
Also, my other component takes considerable time if I ask huge set of data (for example in cases as mentioned in point 3) - Any suggestions to make a better design to handle this case?
Is there any way, other than fetchmore(), to update the model dynamically.
I have spent good amount of time on google to get answers to my questions and I have successfully FAILED. :(
Any help appreciated. Thanks in advance.
Looking for some advice in displaying reports with Google charts (for now table reports, but will go on to other types later)
Are people creating a view for each specific report? Or is it better to re-use an existing view and dynamically create the table from it.
I've found some resources where the table columns are dynamically generated, but I am not quite sure how to check and specify the column to be a string or numeric data type.
If I create views for each report, I know ahead of time what the table structure will be and thus making it easier to create, but perhaps more of a nightmare to maintain down the road.
Any thoughts?
Depending on how often the columns/tables change, one of these will work for you.
Create 10 Views
If your data doesn't change too often, just create 10 different DataViews based on the 10 tables you want to create. Since they all use the same underlying data, any change to the original DataTable will automatically be reflected in all 10 tables, and the performance will be much quicker than creating 10 different tables.
If you change the views often, maintenance may be a hassle, so I would suggest a different approach.
Create a DataView Creation Function
You can create a function that will take an array of columns and create a DataView from those columns. This way you can change the views easily by changing the function call only, and will make your code look simpler. Depending on how you want to set the DataView (whether you use filtered rows and/or columns) the function will be slightly different, but this will allow you the most flexibility to change things while giving all the benefits of having 10 dataviews (updating based on changes to the datatable, etc.).
Automate the Whole Kit and Caboose
If you're going to go that far, you can just automate the entire process. Select the rows/columns you want from the DataTable, give a <div> name (or create a <div> automatically), then create the view and the new table chart drawing function. This will work great if your tables all behave the same (have the same events, options, etc.) as it is going to be of use far in to the future.
On the other side, it is more work than the above two to initially create.
I'm looking for a good way of caching event entries from a big database so that it's not necessary to load the whole database but only timeframes which contain entries which are currently displayed, selected or otherwise needed. Are there classes in Cocoa or Objective-C programming pattern which provide support to implement this?
I have a property database which pulls down list of available properties for sale. The easiest way I found to do this, was to have a date attribute which gets set when the data is first populated. From then on, only the objects which have a time that's expired are updated when someone attempts to view a property. This was the easiest way I found to control the outcome.
I've researched this issue and have not found anything to meet my needs. I am worried that perhaps I'm using the wrong terms.
I would like to build a website interface that allows users to select different variables and then have those variables dynamical or automatically graphed or charted. I need it to be able to handle 100+ variables (there could be limits to how many were charted at one time) and display the data on a bar graph, pie chart, or line graph based on the users preference.
What would I need to make this happen?
Sounds like you need to use either Flash and ActionScript or JavaScript and HTML5.
I've been looking to do something like this too actually.
Need a facility for parsing the data, and then working out scales/ratios and to represent the data in a coherent way, with labels. Then you need to scale the shapes your using according to the scale that the data is covering, and for the sizes to naturally be proportional.