Read the statement by Michael Teeuw here.
I got sucked up into a magic mirror! (and need some help)
-
@E3V3A I think your solution may be overly complicated. Why do you need JQuery?
You can have a look at my recent module MMM-PublicTransportHafas which does exactly what you described:
- has a multicolumn (not) coloured table
- updates every so and so minutes (user configurable)
- uses plain js to generate the table
- uses another api to request JSON-data to populate the table
Maybe this is a good starting point for you.
Can you share your code you have? -
I’ve solved one of the problems with the
blocked due to MIME type mismatch
error above, in this thread. Please look at that answer to import your external jquery related scripts. -
Your MMM look very nice and the code is indeed very clean, although quite different from what I’ve seen so far. However, I’m looking at this as an exercise, since it’s my first Module.
So yes, using jquery + add-ons are definitely overkill, but has not yet been done before AFAICT. As you can see, in the
demo.html
, it makes doing fantastic tables using JSON a super breeze (obviously at the cost of external code and processing bloat). So since I hate making DOM from JS, I rather prefer using tools available, even if it means all this extra work and hair-pulling.I’ll soon update the repo code in the signature, once I get the table up.
-
@E3V3A Thank you! It was indeed my goal to write more readable code. Oftentimes javascript code is a mess and I thought I can do better.
I’ve had a look at your code. It’s quite nice too. But of course it can be improved. ;)
Maybe you should consider putting the methods
processData
,getData
andscheduleUpdate
in another class or at least in thenode_helper.js
file which is meant for exactly this purpose. -
@raywo Hi Thank you fo r taking your time to look at this. I have now updated the code.
It runs and I created a newloadTabulate
function, that is supposed to do exactly the same as in thedemo.html
file…it returns, but nothing is displayed. I don’t know how to debug this, since there are no errors.Perhaps, I just doing this Tabulator inclusion all wrong. I have no idea how to proceed at this point.
-
@E3V3A Your code looks nicer this way. Well done!
What do you want to do next? Try to describe the goal. Maybe you should open an issue in GitHub where you describe what you want to do next. That way you will not forget what you wanted to achieve and others (like me) can see what you’re up to.
BTW: I left some comments on your code on GitHub.
-
@raywo Great! Thanks! I just answered…
What’s next? Well, the table never get shown, so fixing that is next.
Once all this demo works, it’s time to put it all into a module that is actually doing something. -
@E3V3A I have had a look at your code. I’ve opened a pull request. Have look!
-
@raywo Hi Ray! Fantastic!! I just had a look at running your PR, and it works great! I also commented on the PR and the working Module will be pushed and ready in the next day or two. I was so close to giving up on this, so I am extremely grateful and in beer/food/wine debt to you. Thank you!
-
@E3V3A I prefer wine. ;)
I’m looking forward to see your results.