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

184Re: [taffydb] Re: range filteration

Expand Messages
  • Pierre-Olivier Chassay
    Aug 5, 2009
    • 0 Attachment
      Thanks works properly now I filter over 850 elements in my taffydb it's
      even faster than the jquery plugin table sorter!

      tacoman_cool wrote:
      >
      >
      > That's certainly doable although stringify can be pretty expensive to
      > use as part of your normal workflow. It seems to me you may want to
      > use a little of JavaScripts functional nature to get things done. I
      > assume you have some kind of a "search" button. If so you'd need to
      > add an onclick="dosearch()" and then write a function like this:
      >
      > var dosearch = function () {
      > var searchObj = {};
      > if ($("#field1").val() != "") {
      > searchObj["invoice_type"] = {"is":$("#field1").val()};
      > }
      > if ($("#field2").val() != "") {
      > searchObj["invoice_paymentoption"] = {"is":$("#field2").val()};
      > }
      > invoicesSearch.forEach(function (data) {
      > //output data
      > },searchObj)
      > }
      >
      > --- In taffydb@yahoogroups.com <mailto:taffydb%40yahoogroups.com>,
      > Pierre-Olivier Chassay <moonpo@...> wrote:
      > >
      > > Don't know if it's a good practice but I do like that
      > >
      > > invoiceList=invoicesSearch.stringify();
      > > resultData = new TAFFY(invoiceList);
      > >
      > > if ($("#field1").val() != ""){
      > >
      > >
      > invoiceList=resultData.stringify({invoice_type:{"is":$("#field1").val()}});
      > > resultData = new TAFFY(invoiceList);
      > > }
      > > if ($("#field2").val() != ""){
      > >
      > >
      > invoiceList=resultData.stringify({invoice_paymentoption:{"is":$("#field2").val()}});
      > > resultData = new TAFFY(invoiceList);
      > > }
      > > and so on with my different filter I have
      > >
      > > resultData.forEach(function(data){
      > > output the data here...
      > > })
      > >
      > >
      >
      >
    • Show all 6 messages in this topic