by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 18 05:28
    adnanebrahimi commented #231
  • Apr 17 15:06
    alizangiabadicode opened #231
  • Mar 07 19:06
    PiotrCzapla commented #226
  • Feb 29 11:07
    xarkitu opened #230
  • Feb 27 13:47
    PiotrCzapla commented #209
  • Feb 13 17:37
    peterpenguw opened #229
  • Jan 30 23:26
    cesarmtz93-wit opened #228
  • Jan 30 18:32
    cesarmtz93-wit closed #225
  • Jan 29 12:24
    sooriyaprakasht closed #227
  • Jan 29 12:24
    sooriyaprakasht commented #227
  • Jan 29 08:20
    sooriyaprakasht edited #227
  • Jan 29 08:20
    sooriyaprakasht edited #227
  • Jan 29 08:18
    sooriyaprakasht opened #227
  • Jan 28 10:54
    shady786 opened #226
  • Dec 20 2019 17:12
    danilodorgam commented #224
  • Dec 20 2019 16:35
    cesarmtz93-wit opened #225
  • Dec 20 2019 16:32
    cesarmtz93-wit commented #224
  • Dec 20 2019 16:32
    cesarmtz93-wit commented #222
  • Dec 07 2019 19:09

    kilbot on master

    Updating translations for langu… (compare)

  • Dec 07 2019 19:08

    kilbot on master

    Updating translations for langu… (compare)

Thomas Mery
@thomasmery
so I shall create an initializefunction in my Route so something like this
like you do for the pos/products Route
Paul Kilmurray
@kilbot
actually, you’re right!
if it’s above the ReportsView it will return undefined because the app hasn’t started yet
in the Route.initialize is the correct spot for this
so everytime the reports route is triggered, it will get an instance of the orders collection
Thomas Mery
@thomasmery
blob
pushed what I did to the repo
Paul Kilmurray
@kilbot
cool, you managed to pick my bug .. the missing ‘get'
awesome, very impressed
so we’ll pass that into the Reports View as an option
Thomas Mery
@thomasmery
mmm not so :) I actually copied from pos/products/route.js
but thanks ;)
ok on to the View
Paul Kilmurray
@kilbot
ie:
{
  collection: this.collection
}
Thomas Mery
@thomasmery
ok, I guess I have to render after fetch has finished
Paul Kilmurray
@kilbot
good work … I was going to explain that after .. but it’s great that you’re reading the code
so, as part of my custom Route object, it will call the fetch method (if there is one)
this returns a promise, so that the view does not render until the data is available
in the case of IndexedDB this is 10-20 ms
in the case of WC REST API this could be a minute on some servers
so in the Route, the fetch must complete before the render starts
Thomas Mery
@thomasmery
from what I understand your custom Route makes sure of that
Paul Kilmurray
@kilbot
yep
Thomas Mery
@thomasmery
ok I'll probably dig to see how it's wired
Paul Kilmurray
@kilbot
the custom route file also loads a ‘loading’ view while the data is downloading
what you’re doing is great … all entities and routes and views will follow this pattern
Thomas Mery
@thomasmery
should I be able to log this.collectionin the template function in the View?
Paul Kilmurray
@kilbot
the template function will actually get an array of items, see here: http://marionettejs.com/docs/v2.4.7/marionette.itemview.html#rendering-a-collection-in-an-itemview
we’ll deal with that later .. because it’s a bit complicated
Thomas Mery
@thomasmery
ok
Paul Kilmurray
@kilbot
for now, lets just use a Marionette helper called templateHelpers http://marionettejs.com/docs/v2.4.7/marionette.view.html#viewtemplatehelpers
Thomas Mery
@thomasmery
ok I'll have a look - can we resume in an hour or so? will u be here?
Paul Kilmurray
@kilbot
yep, I’ll be here!
Thomas Mery
@thomasmery
ok - à tout à l'heure !
Paul Kilmurray
@kilbot
I’m about to head out, so I’ll just post the full ReportsView here:
    var ReportsView = app.ItemView.extend({
        template: _.template('<%= total %>'),
        templateHelpers: function () {
            return {
                total: _.sum( this.collection.map('total') )
            };
        }
    });
I mostly wanted to introduce Backbone.Radio as a way to pass data around the app.
And also the Entities service
Thomas Mery
@thomasmery
ok
I'll have a look at all that in details
Paul Kilmurray
@kilbot
That’s pretty much it though … the route (controller) and the view gets filled out and pretty soon you have a reports page :)
I should also point out that the current repo has known bugs .. so don’t be too alarmed if you see something broken
Thomas Mery
@thomasmery
ok,
I'll probably only be available afternoons this week end but same time monday would work for me if you want to go on with other areas
Paul Kilmurray
@kilbot
just sent you a quick email … I’ll be online this weekend so send me an email or ping me here if you want to chat
bonne nuit!
Thomas Mery
@thomasmery
got the email, thanks - really enjoyed these sessions - talk to you soon!
Jordan Bartholomew
@tourdejord
Hello
Avinash Sengar
@avisengar6
I have looking for it and find this one http://woopos.com/point-of-sale Suggest me?
dlwebdesign
@dlwebdesign
is anyone here?