Creating a custom view

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vampirefrog
    Member
    • May 2017
    • 45

    Creating a custom view

    Hello. I am trying to create a custom view, but I have no idea where to start. The view is for a create entity page. Let's call the entity 'review'. It has a foreign key (many to one) to an entity, let's call it 'movie', and the movie entity has a many to many relationship with another entity, let's call it 'directors'. The review entity also has a one to many relationship with a 'director review' entity. In plain words, I'd like to force the user to review both the movie and all its directors. That means creating a view listing all the fields in the 'review' entity that need to be filled, let's say rating and comment. But also it needs to allow input of reviews for each director related to that movie. Then, it would save the review data in the review entity and in the director review entities.

    I am not sure where to start, documentation seems quite thin and the code seems quite complex. I haven't found an existing entity that does something similar. I think I should wait for an event on the 'movie' field, and when a movie is selected, the movie field, besides becoming read-only, would trigger an ajax loading every director related to that movie, then creating a box with all the fields for each director, but I have no idea how to do that. Then, when saving, I would check if all the fields were filled in, or perhaps the existing code does that already for fields marked mandatory.

    I am quite lost, any help is appreciated. Thanks!
    Last edited by vampirefrog; 12-07-2017, 02:19 PM.
  • vampirefrog
    Member
    • May 2017
    • 45

    #2
    I wouldn't mind simply including the director review edit view in my view somehow, and just adding the director name as text above each one.

    Comment

    • vampirefrog
      Member
      • May 2017
      • 45

      #3
      I seem to have found something in client/src/views/dashlets/options/base.js, now trying to make sense of it.

      Comment

      • vampirefrog
        Member
        • May 2017
        • 45

        #4
        Just trying to figure out how to create a model for an entity object loaded with ajax, so that I can pass it to views/record/detail-middle. Any idea where I should look? Thanks!

        Comment

        Working...