The "create" view JS?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • planetrocke
    Junior Member
    • Feb 2017
    • 25

    The "create" view JS?

    This may be completely obvious... I've been working on /record/detail.js in my module, but I can't seem to figure out what makes /#<entity>/create work. I want to apply the same things I'm doing in edit details to when a new item is created. Thanks.
  • jakub.skowron
    Junior Member
    • Jan 2020
    • 21

    #2
    Inovke view in edit mode

    PHP Code:
    this.createView('DesiredEntity', 'views/record/edit', {
    mode: 'edit',
    model: model,
    el: this.getView('YourViewWhereYouWantCreateView'),
    buttonList: [{
    name: 'save',
    label: 'Save'
    }, {
    name: 'close',
    label: 'Close'
    }]
    }, function (view) {
    view.render();
    }.bind(this)) 
    

    Comment

    • planetrocke
      Junior Member
      • Feb 2017
      • 25

      #3
      Thank you, I was asking more for the JS side... this helped jog my memory that /views/record/edit does look to be what "create" uses.

      Comment

      • jakub.skowron
        Junior Member
        • Jan 2020
        • 21

        #4
        I write code in js, this is how I create view ( for new record creation ) on frontend

        Comment

        • planetrocke
          Junior Member
          • Feb 2017
          • 25

          #5
          I'm sorry I realize that now... I'm not sure why it said PHP Code, as that does look like JS.

          Comment

          Working...