Announcement

Collapse
No announcement yet.

Passing model to 'modal/edit' view ?

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

  • Passing model to 'modal/edit' view ?

    I have already the model for an entity that I am about to show the edit modal for, but when I pass the model, id and scope in the options it would still make a new api request for the entity data, causing a noticeable delay in render time since mouse click.

    How do I correctly pass the model to the modal edit view? Is there a way to cache or cancel the sync, like a 'before:sync' event and return the existing model?

    PHP Code:

    var id='123'; var scope='Lead'; var viewName 'views/modals/edit';
    var 
    model = {/* model is already got from server */};

    this.createView('quickEdit'viewName, {ididscope:scopemodelmodelmode'edit'fullFormDisabledtrue}, function (view) {  
     
    // api has been called twice...

    Last edited by tothewine; 02-01-2019, 11:25 AM.
Working...
X