scorpiusjs / scorpius

Modular admin solution built with Meteor
http://scorpiusjs.org
MIT License
34 stars 7 forks source link

Tabular rendering of relationships #42

Open mmazloum opened 7 years ago

mmazloum commented 7 years ago

In Orion we could do something like :

  tabular: {
    columns: [
      {
        title: 'Nom du Bureau',
        data: 'bureauName'
      },
      {
        title: 'Nom du Bureau',
        data: 'bureauId',
        render: function(val, type, doc) {
          console.log(val);
          console.log(Bureaux.findOne({_id: val}));
        }
      }
    ]
  }

To render data from a related collection in the collection tables that appears in the admin.

Here the console.log() for Bureaux.findOne({_id: val}) returns undefined even if I'm sure the id passed through val is related to a correct document.

Am I missing something ?

mmazloum commented 7 years ago

If I add the autopublish package everything works fine but that's not the best way to do ;-)

rwatts3 commented 7 years ago

Interesting . Would you mind sharing the repo so I can try to reproduce ?
Or is this a private project ?

mmazloum commented 7 years ago

@rwatts3 I added you to a repo

I'll send a email to reproduce.

mmazloum commented 7 years ago

since I couldn't find your email :

If you want I can create a specific branch with the error directly.

rwatts3 commented 7 years ago

Is this still an issue ? Seems to me that it may have been a pub sub issue.

mmazloum commented 7 years ago

I confirm this due to pub subs, if i leave autopublish on, tabulars and relationships work fine. If you need some testing i have several projects using scorpius, i can share core or try some updates of packages versions at night.

rwatts3 commented 7 years ago

Ok, the next version of Scorpius is under development and will be released soon. I believe this issue may be related to a dependency on an older version of Meteor. Once the upgrade is complete, and testing is complete I will double check to see if this issue still exists.

rwatts3 commented 7 years ago

Sorry I was not able to check the repo when you sent it. Could you send me a pm on gitter with a direct link to the project.

My initial thoughts are it may be related to when the collection is loaded.

In the old Meteor files in the directory were loaded in alphabetical order.

mmazloum commented 7 years ago

since It's a bit old I'd suggest I try again on your lattest scorpius updates and get back to you ? I'm on hollydays right i should take a look in July, ok ?

if I remember well and if it can help, when i added autopublish it worked, but failed when autopublish was off.

2017-06-30 7:36 GMT+02:00 Ryan Watts notifications@github.com:

Sorry I was not able to check the repo when you sent it. Could you send me a pm on gitter with a direct link to the project.

My initial thoughts are it may be related to when the collection is loaded.

In the old Meteor files in the directory were loaded in alphabetical order.

  • What version of Meteor are you using ?
  • Are you using es6 modules ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/scorpiusjs/scorpius/issues/42#issuecomment-312179547, or mute the thread https://github.com/notifications/unsubscribe-auth/ADdWA3L1N82bDd-et6sm7EUoomUCPR56ks5sJIlPgaJpZM4Lfixy .