Loading ...
Sorry, an error occurred while loading the content.

Re: For instance

Expand Messages
  • tacoman_cool
    Ahh, sorry. I forget that fruits isn t a TAFFY collection at this point. Try this: var init = function () { var fruits =
    Message 1 of 6 , Jun 11, 2009
    • 0 Attachment
      Ahh, sorry. I forget that fruits isn't a TAFFY collection at this point. Try this:

      var init = function () {
      var fruits = TAFFY(TAFFY(fruits).get({sugar:{greaterthan:12}}));
      fruit = gridPrinter2({ containerID: "displayGridDiv2" },
      fruits);
      fruit.print();
      };

      --- In taffydb@yahoogroups.com, "Bruce" <bfr@...> wrote:
      >
      > Tried this, including correcting unmatched brackets from your example; but it didn't work.
      > I'd really like to see a working example.
      >
      > var init2 = function () {
      > fruit2 = gridPrinter2({ containerID: "displayGridDiv2" },
      > TAFFY( fruits.get({ sugar:{greaterthan:12}})) );
      > fruit2.print();
      > };
      >
      > --- In taffydb@yahoogroups.com, "tacoman_cool" <ian@> wrote:
      > >
      > > Hey Bruce,
      > >
      > > So I think this is where you need to do. Mind you it has been a while since I wrote the grid example.
      > >
      > > The gridPrinter expected the element ID you want to insert the grid into and the collection to build the grid from. It isn't built to expect a query, but that isn't a big deal.
      > >
      > > In theory you can do this (can't test at the moment):
      > >
      > > var init2 = function () {
      > > fruit2 = gridPrinter2({ containerID: "displayGridDiv2" },
      > > TAFFY(fruits.get({ sugar:{greaterthan:12})));
      > > fruit2.print();
      > > };
      > >
      > > Since .find() only returns an array of numbers you were passing in an array instead of a TAFFY object. By using .get() you can wrap up the collection as a new TAFFY object.
      > >
      > > You could also modify gridPrinter to accept a TAFFY lookup object as an argument and pass it on to the TAFFY collection. That would let you wrtie something like:
      > >
      > > fruit2.print({sugar:{greaterthan:12});
      > >
      > > Ian
      > >
      > > --- In taffydb@yahoogroups.com, "Bruce" <bfr@> wrote:
      > > >
      > > > Tried this, didn't work
      > > >
      > > > var init2 = function () {
      > > > newFruit = TAFFY(fruits);
      > > > fruit2 = gridPrinter2({ containerID: "displayGridDiv2" },
      > > > newFruit.find( sugar:{greaterthan:12}); );
      > > > fruit2.print();
      > > > };
      > > >
      > >
      >
    • Bruce
      OK, I was able to get that to work, thanks.
      Message 2 of 6 , Jun 11, 2009
      • 0 Attachment
        OK, I was able to get that to work, thanks.
      Your message has been successfully submitted and would be delivered to recipients shortly.