meteor-blaze-components icon indicating copy to clipboard operation
meteor-blaze-components copied to clipboard

[Question] About aldeed:tabular

Open emehmet opened this issue 9 years ago • 5 comments

Template does'nt work as BlazeComponent class where Template is defined in aldeed:tabular tmpl.

for example like below:

{
    tmpl: Meteor.isClient && Template.SilPersonel
}

We defined Template.SilPersonel as BlazeComponent class but it dosen't work.

emehmet avatar Mar 23 '16 13:03 emehmet

Hi @emehmet : After upgrade to meteor 1.3 I just stumbled upon the same problem... it seems like the strict mode (having to remove templating) might be the reason... in meteor 1.2 I still had [email protected] loaded - now in meteor 1.3 it is removed.

did you find a solution for this?

thebarty avatar Apr 06 '16 20:04 thebarty

Hm, can somebody make a small reproduction here?

mitar avatar Apr 06 '16 20:04 mitar

just a little update:

I got a 1.3 project with BlazeComponents installed (standard blaze-stuff is removed and replaced by blaze-components)

Case 1 (works) ... when loading eagerly (/client /lib) and doing a console.log(Template.whatever) I am seeing an array with the first element of type Blaze.Template

Case 2 (does NOT work) ... when loading non-eagerly (imports/module/client imports/modele/lib) and doing a console.log(Template.whatever) I am seeing an array with the first element of function (viewName, renderFunction).

So I am getting 2 different return types. In case 2 a Template.whatever returns undefined causing `àldeed:tabular`` to fallback to standard-mode and NOT show the template. Case 1 does work. Case 2 does NOT.

thebarty avatar Apr 06 '16 20:04 thebarty

OK, I found the solution. it has NOTHING to do with BlazeComponents, but with getting to know how 1.3 modules work.

in imports/lib/tabular.js add the following to the TOP of the file:

if (Meteor.isClient) {
  require( '../client/template.html' )  // html including the cell-template
}

this will introduce the template to the namespace of the file and lets console.log(Template.whateverTemplateName) return a valid template instance.

@emehmet: does this work for you?

thebarty avatar Apr 06 '16 21:04 thebarty

it doesn't work on me. But i so solded so. I use template event just for this part Template.SilPersonel.events({ but this is not a true solution.

emehmet avatar Apr 07 '16 09:04 emehmet