Announcement

Collapse
No announcement yet.

Adding a new route

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding a new route

    Hello. I noticed that in client/src/router.js, the default routes are defined. But how would I go about adding my own route? It is of the form /#Controller/abcd/1234, where abcd is the new route's name and 1234 is the entity ID.

    It is similar to /view/ or /edit/ but I don't know where to initialize it (without editing routes.js).

    Thanks!
    Last edited by vampirefrog; 11-28-2017, 01:54 PM.

  • #2
    In fact, all I really want is to be able to navigate to an entity record, but also open a modal or some sort of special (i.e. not detail or edit) view.
    Last edited by vampirefrog; 11-28-2017, 02:51 PM.

    Comment


    • #3
      Alright, I've discovered how to make the url (it has to be of the form /#Foo/view/1234?param1=true), but how do I get param1 in a view? What is the correct way to do this, because the default controller seems to hide params from views. Should I create a new controller, or is there a way to get the param from a view? I just want to show a modal when that param is set.

      Comment


      • #4
        Hi
        an example client/src/views/modals/edit.js actionFullForm

        Comment


        • #5
          In the meanwhile I've used var options = this.getRouter()._last.options.

          Comment

          Working...
          X