Get all entity data by entity ID

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • ming
    commented on 's reply
    [WTA] hi yurikuzn, i have a question on how do i get all data using entity id, so i can create another data to another entity using same data?
    i made a new action button on list.js on custom entity which is:-
    actionSetTransfer: function (data)

    How can i get all data from selected id? and transfer to other entity?
    Thank you in advance.

  • The50
    replied
    Thank you, it works!

    Leave a comment:


  • yuri
    replied
    PHP Code:
    
    data: function () {
       return {
          objectList: this.objectList
       }
    },
    
    setup: function () {
      Dep.prototype.setup.call(this);
      this.wait(true);
      this.getAjaxPostRequest(...).then(function (result) {
         this.objectList = result;
         this.wait(false);
      }.bind(ths));
    } 
    

    Leave a comment:


  • The50
    commented on 's reply
    Already tried that, it looks like this now https://pasteboard.co/H1Z96nZ.png Still I don't get any data in that console.log. If I do console.log on Ajax function .then method - data exists.

  • tanya
    commented on 's reply
    define objects in setup method

  • The50
    replied
    Originally posted by tanya
    Hello
    No, it's not a bad way
    There is another issue. I make an AJAX request like this https://pasteboard.co/H12qVsx.png and try to parse it into the template in data function. The problem is that AJAX requests takes a second to load and by the time page loads - there is no data in variable "objects". How could I make it load the data properly? I am trying to use the async option but it doesn't work.

    Leave a comment:


  • tanya
    replied
    Hello
    No, it's not a bad way

    Leave a comment:


  • The50
    started a topic Get all entity data by entity ID

    Get all entity data by entity ID

    Hello,

    I made an override of Quotes entity and made a relation with new entity named "Object". In data::function() method I want to collect all the information of entity "Object" records. So far I have ID's of those records only. I reach them by using this.model.attributes.objectnames. Is there a function something like getEntityById or do I have to write a PHP function to get it? How could I do so?

    At the moment I made a post ajax request to Quote controller and I get all the necessary information in that file, but it looks like a bad way to do so. Isn't it?

    Thanks.
    Last edited by The50; 12-28-2017, 04:54 PM.
Working...