scorpius icon indicating copy to clipboard operation
scorpius copied to clipboard

Tabular rendering of relationships

Open mmazloum opened this issue 8 years ago • 9 comments

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 avatar Jan 10 '17 15:01 mmazloum

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

mmazloum avatar Jan 10 '17 15:01 mmazloum

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

romans127 avatar Jan 10 '17 22:01 romans127

@rwatts3 I added you to a repo

I'll send a email to reproduce.

mmazloum avatar Jan 16 '17 09:01 mmazloum

since I couldn't find your email :

  • download repo
  • just switch to branch 'new-gold'
  • then meteor update with all packages
  • launch project with meteor -> you may have error prompts to install babel et bycrypt
  • install packages and modules that the meteor cli asks for
  • re run the project with the meteor cli and the error should appear.

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

mmazloum avatar Jan 16 '17 09:01 mmazloum

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

romans127 avatar Jun 18 '17 15:06 romans127

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.

mmazloum avatar Jun 19 '17 08:06 mmazloum

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.

romans127 avatar Jun 19 '17 14:06 romans127

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 ?

romans127 avatar Jun 30 '17 05:06 romans127

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 [email protected]:

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 .

mmazloum avatar Jun 30 '17 12:06 mmazloum