MultipleDetailViews with navigation controllers on both sides of SplitViewController - uisplitviewcontroller

I need to show a list of categories on the left, and when a user selects a category, I need to show a list of items of the selected category on the right. Then, if a user selects a list item on the right, I need to show the details of the selected item (again on the right).
So I am using Apple's sample MultipleDetailViews as a template, with a tableview on the left, and multiple detail viewcontrollers on the right. When a category is selected on the left, I create a navigation controller on the right and push a tableview controller to display the list of items in the category. When an item is selected on the right, I push a new tableview controller to display the details of the item. All this is working fine.
Now some of the categories on the left have sub-categories. I could show the sub-categories on the right in a UITabBar, but I've been asked to display the sub-categories on the left. So I need to push a new tableview controller on the left - which I have been able to do.
When I select a row in the new tableview on the left, I would like to create a new navigation controller on the right - just like I did for items in the main categories. I cannot get this to work and I know it is because the new tableview controller doesn't know anything about the DetailViewControllers. But I can't figure out how to get this working. Any ideas anyone?

Figured it out with help from another forum. If anyone is interested, here's the solution:
RWForums

Related

NSTableView (or NSOutlineView) column hiding through contextual menu : a "no code" solution

I searched SO for the best solution to this question, found several clues, while not fully satisfying IMO. So I post below my no-code solution.
The goal is to have, as in Finder or other native applications, a contextual menu on the header bar of a table or outline, allowing to select which columns are visibles.
In IB storyboard, add all the columns you need into the table view.
You may set some of them hidden by default.
Ctrl-drag each column from the IB document outline view to the scene controller code view, in order to automatically create weak IBOutlets for each column. The purpose is to be able to target a given column in bindings.
__weak IBOutlet NSTableColumn *my_column;
Add a menu to the storyboard scene with the same number of item as the columns you plan to hide. You do not have to give title to menu items (see next point).
For each menu item, in the bindings pane, add two bindings :
Bind the item title to the column title property through your controller outlet : controller_name.my_column.title. This way the menu item will stay in sync with column title, should the code need to change it.
THIS ONE IS KEY : Bind the value of the menu item to the column hidden property : controller_name.my_column.hidden. Add a NSNegateBoolean transformer for the menu tick to be meaningful.
Attach the menu to header menu : ctrl-click on the table header view and make connection from the menu outlet to the menu created in #3.
That it's. No code beside the IBOutlets added in #2.
The bindings being two ways, un-ticking a menu item will hide the bound column. Also, if the code hides a column the bound menu item will reflect its state.

Want to re-instantiate a component when navigating to same aux route

I have a list of items with Actions drop-down for each item in the left-section of page. I also have a right rail which displays a different component based on action type selected. I'm using aux-route to accomplish this.
One of the Action the user can take is "edit" where in a form is displayed to edit the metadata of the list item. While editing, user can click on + button next to some of the input field to add another input field dynamically.
Now my problem is, when the edit-form is open for a list item and I click edit on another item in the list, I wanted my edit-component to be re-instantiated.
Because the aux-route is same for all the list items for edit-action, edit-view is not instantiated once again. Is there a way to achieve it?
Right now fixed it with RouteReuseStrategy

Display one data tree in two different views

Hello everyone.
I have a tree of items as shown on image above (Items tree).
I need to display this tree in a way that is shown on an image (Views).
It has two views, Tree View and List view. Tree view should display the whole tree of items, and list view should display properties for a selected item in a tree view. (On an image it displays properties for a cat item)
The way it is implemented right now is displayed at "Current implementation" part of an image. TreeModel contains item tree, and when you click on an item in a TreeView, current item is sent to a ListModel to display it's properties.
The issue thagt i encounter here is that in both views items are editable. In a tree view you can edit item's names, and this change should appear in a list view as well. The same goes for opposite direction. Changing name of a Cat item should reflect on a treeView cat item.
Since it is two different models, the change is made only when you hover over another view.
What i currently did is for a changed item in one of views, i search for a item in a another view via QModelIndex::match() and then just update that part of a view via emit dataChanged(). I am not sure this a good way. So if maybe you can give me some ideas on how this can be done better.
Thank you.
You should have only one model. The QAbstractItemView::setRootIndex method is all you need: you can set the current item in the tree as the root for the table view. Alternatively, you could use a proxy viewmodel to adapt the data for display in a particular form.

Display user most frequent menus in page

I have a website that it has more than 50 menu items. I want to add a functionality to the website by which, users be able to choose his/her most frequent menu items and add them on the right side of the main page. It can help the user to find links easily.
How can I do this or what's your suggestion to accomplish this in the best way?
Thanks
My Suggestion over this, is Create New SQL table, with Column UserID, and FavMenuItemID.
Create Table userFavMenuItem(
UserID INT,
FavMenuItemID INT
)
Do not forget to add foreign key constraints for both these columns.
So once user choose any Menuitem as Favorite, add a new row and when user want to delete any menu item, delete from this table based on UserID, and FavMenuItemID.
Now, to show Current Favorite menu items on right hand side, Just Get Favorite Menu itmes from this table using UserID.
EDIT
You have to create new page, where user can choose their Fav Menu Item(add/Delete), and also change their previous Fav selection also (at most user can have 5 Fav menu items), and also restrict user to choose only 5

PushViewController after presentModalViewController like in Apples Alarm Clock app

my Question is quite simple.
I have an add-button. When I tap on it --> presentmodelviewController presents a UIViewController, which contains a simple Table with cells.
When I tap on a Cell, i want to display a new View using pushViewController, which automatically creates a "back Button".
At the top of it in this new View i have a Textfield, where I can enter some Text.
When I tap the back-button, the view slides back to the add-View (which was presented using modalView...).
Now i want the text edited in the view before to be placed in the Label of the first row (cell) on which I tapped.
So I want to do this for 5 cells. Each of them presenting another xib.
Please, can anyone help?
Thanks for your helpful replies.
You should first present a modalviewcontroller that has a navigationcontroller within. Within this view, you can now push other view controllers.

Resources