Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Custom NavigationProvider: Append Id of Parent to Children #4459


User avatar
0
strix20 created

Hello,

We are wanting to create a reusable sub-nav / menu for a series of pages that belong to an entity.

For example, the main navigation provider has a link to 'Companies'. Clicking this navigates the user to a list view of companies where the user can then click the Action drop down to then navigate to the 'Details' view of a company.

The 'Details' view of a particular company is where we want to create a reusable navigation provider for a left navigation which will have other pages that are associates of a Company Entity such as Company Documents, Contacts, Addresses etc.

What is the best approach to appending the Company Id to these links if we are using a custom menu that extends the NavigationProvider class? Thanks.


4 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    you can inject Company repository to AppAreaNameNavigationProvider then get list of entities to build your own navigation. you append the ID to the URL property. Try out and write your feedback.

  • User Avatar
    0
    strix20 created

    Imagine you have the standard top menu for the application, you navigate from the tenant page to a tenant details view.

    There is a left nav built using the navigation provider, that has an edit and delete link to pages instead of modals.

    Those edit and delete links reference actions that have a parameter, but the navigation provider does not appear to support actions with parameters.

    (This is not our exact scenario, and is only presented as an example.)

    We are trying to determine the best approach to fit our needs, because we will have a lot of menus like this, and we don't want to make extensive customizations to the NavigationProvider class in the event it gets updated in the future, unless we absolutely have to.

  • User Avatar
    0
    bbakermmc created

    Why not on your list of "Companies" have the options to goto documents, edit, delete, details etc? We tend to keep everything on the same page via modals. Not sure if your visual use case is different and such :)

    EX: in the ... on the row we have all the options listed.

    Or something like this:

  • User Avatar
    0
    strix20 created

    Part of the answer is "Them's the requirements." Stakeholders and such.

    Part of the answer is, some of the forms take up multiple pages, and modals are very poorly suited for displaying the content, so the navigation must direct to full pages.

    We can manually create the menu on each page, but that is less than ideal, for obvious reasons.

    My current thinking is to add an additional params string[] parameter to the view component itself, and in the menu definition use a string format pattern. Then I can add an string[] to the MenuItemViewModel, and update the CalculateUrl extension to accept the params as well.

    But this only works if every menu item requires the same params, which may or may not be the case for some applications.