Options for a slow loading Webview - cocoa

I have a Webview in a Cocoa application that essential shows a HTML table plus a few other items. The table can get very big, in the 10's of 1000's cells. When called the view takes a long time to load which seems to be just because of the size of the table that is being shown.
I'm looking to decrease the time it takes to show the view. The obvious 'quick and dirty' method of speeding this up is to show the table in sections with a link going forward and backwards through the sections of the table so only a smaller section of the table is shown at once. Is there a more elegant way of doing this that allows the whole of the table to be shown in the Webview at once or a way to incrementally load the table?

Is it important that the data is shown in a WebView? Performance will be a LOT better if you use an NSTableView and populate it with data that you obtain via a web service.
NSTableView loads data lazily, so you never need to populate more than the number of cells that are actually visible.

Related

Load additional ag-grid table rows based on browser window size and/or scroll bar being scrolled down

I'm looking to apply infinite scrolling to an ag-grid table with a large amount of data on page where 50 new rows will be added at a time based on the BROWSER height and/or scrollbar being scrolled down, instead of the TABLE size and/or scroll bar being scrolled down.
I tried domLayout='autoHeight' but that seems to only affect the table. Note: I will be using a large amount of data in this table and I'd like to do this using ag-grid properties and events, etc if it's possible to do it with solely ag-grid.
I’d like it to function like this example:
http://intercoolerjs.org/examples/infinitescroll.html
See how the table loads more data as the user scrolls with the BROWSER scrollbar?
I need and answer by 4PM Mountain Time if possible.
Thanks in advance for any help!
Dave

Handle Touch Event when main queue is already occupied with heavy UI updates

I have a scrollview and table view in one screen. Both of them contain heavy data as its a trading app. So every second I receive and update in the value and call cell update. Meanwhile if the user tries scrolling the scrollview,it doesnt respond, though the scroll delegates are called.
Any help will be appreciated. Thanks
You should try to investigate two things:
When you say you have a table view and a scroll view, I hope you are not putting your table view inside a scroll view, and increasing the content height of scroll view and table view. If you do this, you will be making multiple cells, and loading all the cells in memory. This technique doesn't go well with dequeueReusableCellWithReuseIdentifier.
Only do the UI update on main queue, calling and receiving data should not be done on main queue.
I suspect that you may be doing something wrong in point 1. How many cells would you show at one time on an iPhone/iPad screen, max 10-15 cells. If you reuse cells and have 10-15 cells in memory, your app won't go slow.

NSTableView as a form - nextKeyView issue (or how to force load all rows)

Perhaps using an NSTableView as a form is a terrible idea, but I've got it working pretty well in every respect except that you can't tab from field to field.
I have a table with a label column and a field column. I also have an array that keeps track of each row in the table with its accompanying NSTextField control. The controls are set in the array as they are loaded during tableView(tableView: viewForTableColumn: row:).
After the tableview is drawn, I run through each control in the array and set its nextKeyView to the following control.
This works swell, BUT only for those controls which have been displayed on screen. Because the control isn't added until it's loaded, table rows which are off-screen aren't hooked up.
My current approach (which is awful) is to manually scroll the table several times in order to force everything to load, then set all the nextKeyViews. I haven't got it working very well yet, so I was hoping someone had a better idea. Force-loading all views, if it works, should be an OK solution, but there may be something smarter out there too.
I guess the answer is
table.scrollRowToVisible(<row>)
This will show the row you want to see.

MFC Application Updating Only Current View

I divided the Main View of my VC++6 MFC application using Static Splitting with rows and columns like (1x2) or (3x3) and so on.
One of these parts, when clicked on, is the Active View.
When I draw a shape say, a circle/rectangle on the Active View, all the other Views ape the shapes I drew on the Active View. How do I avoid that?
I tried UpdateAllViews() with the Active View as first argument. It still does the same.
Any ideas?
If you are using the same class for all views this is expected behavior, since splitter wires all views to the same document object. I presume that you are use document object for drawing data storage.
UpdateAllViews is used for to update views if data in the document change. Each view then uses document’s data to render different visual interpretation of this data. Hence each view would be a different type (represented by different classes) knowing how to visualize data.
For example: document is used to store number array. Three views are showing those numbers as decimal, hex and binary representation.
If one number is changed, all views are notify to update own representation.
In your case working solution would be to move drawing data to the view rather than the document. Most likely your application does not need a document at all.
UpdateAllViews() calls the OnUpdate() function for each view. The default implementation of OnUpdate() invalidates the client area (talking about simple "graphics" views like CView() or CScrollView()). You can override the OnUpdate() member and encode the desired behaviour (as far as invalidating/updating is concerned) in the lHint and/or pHint parameters.

Horizontal NSTableView (i.e. entity data per column vs. standard entity data per row)

I am trying to create a Mac OS X Cocoa based application with data displayed in a tabular format, but the data needs be displayed vertically in one column per entity instead of the standard NSTableView one row per entity functionality.
Is there an appropriate Cocoa class for this? Essentially I'm looking for a "horizontal" table of NSControls, but I do not need headers, sorting, etc. I just need a view to bind my core data array of entities to that displays the data in various NSCells depending on the field. (i.e. instead of one column of checkboxes and another column of textfields, I need one row of checkboxes and another row of textfields, etc.)
Thanks!
There is no pre-baked Cocoa control that handles this exactly like a table, just in "vertical" mode.
You might try NSCollectionView set to one row and unlimited columns. Create your NSCollectionViewItem (as the "prototype" or template) in a vertical configuration and you should be good to go for the most basic needs and even throws in some pretty animation.
The problem is, it's only available starting at 10.5 and is a lot less useful unless you're targeting 10.6 as a minimum. Even then NSCollectionView/Item can quickly become too unwieldy if your needs go beyond the basics it provides. At that point, creating your own home-brewed equivalent that targets what you need might be easier.

Resources