Quantcast

Refreshing a grid with a RequestMemory store

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Refreshing a grid with a RequestMemory store

Harry Devine
My dGrid has data fed by a RequestMemory store wrapped in Observable like this:

store = new Observable(new RequestMemory({url: "getData.php",
  getChildren: function(parent, options) {
    return this.query({parent: parent.id}, options);
  },
  mayHaveChildren: function(parent) {
    return parent.hasChildren == true;
  }
}));


When I add or remove items from the store using store.add(...) or store.remove(id), I call grid.refresh.  However, the grid does NOT refresh.  I have to physically refresh the page to have the grid changes reflected.  How do I get the grid to refresh and show the updates?


Thanks,

Harry


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Refreshing a grid with a RequestMemory store

Harry Devine
I wanted to add that dGrid is 0.3.16 and RequestMemory.js is from dojo-smore 0.2.0.  Should I be taking a step back and move to dGrid > 0.4 and use dstore?

Harry

Sent from my iPhone

On Jul 12, 2016, at 11:18 AM, Harry Devine <[hidden email]> wrote:

My dGrid has data fed by a RequestMemory store wrapped in Observable like this:

store = new Observable(new RequestMemory({url: "getData.php",
  getChildren: function(parent, options) {
    return this.query({parent: parent.id}, options);
  },
  mayHaveChildren: function(parent) {
    return parent.hasChildren == true;
  }
}));


When I add or remove items from the store using store.add(...) or store.remove(id), I call grid.refresh.  However, the grid does NOT refresh.  I have to physically refresh the page to have the grid changes reflected.  How do I get the grid to refresh and show the updates?


Thanks,

Harry


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Refreshing a grid with a RequestMemory store

Rob Gillan-2
Harry,

We made a similar move to latest dGrid/dStore about 4 months ago and have never looked back.  The API has changed slightly and you need to use Trackable (rather than Observable).  I’d recommend it if you have the time.  The method of querying/filtering the store is also different (but a lot more logical).  Reach out if you run into any issues but we found it a pretty painless process.

Cheers
Rob



On 14 Jul 2016, at 4:26 am, Harry Devine <[hidden email]> wrote:

I wanted to add that dGrid is 0.3.16 and RequestMemory.js is from dojo-smore 0.2.0.  Should I be taking a step back and move to dGrid > 0.4 and use dstore?

Harry

Sent from my iPhone

On Jul 12, 2016, at 11:18 AM, Harry Devine <[hidden email]> wrote:

My dGrid has data fed by a RequestMemory store wrapped in Observable like this:

store = new Observable(new RequestMemory({url: "getData.php",
  getChildren: function(parent, options) {
    return this.query({parent: parent.id}, options);
  },
  mayHaveChildren: function(parent) {
    return parent.hasChildren == true;
  }
}));

When I add or remove items from the store using store.add(...) or store.remove(id), I call grid.refresh.  However, the grid does NOT refresh.  I have to physically refresh the page to have the grid changes reflected.  How do I get the grid to refresh and show the updates?

Thanks,
Harry
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Refreshing a grid with a RequestMemory store

Harry Devine
Thanks Rob!  I just downloaded dGrid 1.1.0 and dstore 1.1.0 and I'm going through the migration guide currently.  What I don't want to do is break any of the projects that I currently have going with the "older" dgrid.  Any thoughts or recommendations that you have on having both versions exist together until I can get the newer version working, or any notes on how you migrated, would be greatly appreciated.  Feel free to contact me off-list if that's easier.

Thanks!
Harry


From: "Rob Gillan" <[hidden email]>
To: [hidden email]
Sent: Wednesday, July 13, 2016 7:55:42 PM
Subject: Re: [Dojo-interest] Refreshing a grid with a RequestMemory store

Harry,

We made a similar move to latest dGrid/dStore about 4 months ago and have never looked back.  The API has changed slightly and you need to use Trackable (rather than Observable).  I’d recommend it if you have the time.  The method of querying/filtering the store is also different (but a lot more logical).  Reach out if you run into any issues but we found it a pretty painless process.

Cheers
Rob



On 14 Jul 2016, at 4:26 am, Harry Devine <[hidden email]> wrote:

I wanted to add that dGrid is 0.3.16 and RequestMemory.js is from dojo-smore 0.2.0.  Should I be taking a step back and move to dGrid > 0.4 and use dstore?

Harry

Sent from my iPhone

On Jul 12, 2016, at 11:18 AM, Harry Devine <[hidden email]> wrote:

My dGrid has data fed by a RequestMemory store wrapped in Observable like this:

store = new Observable(new RequestMemory({url: "getData.php",
  getChildren: function(parent, options) {
    return this.query({parent: parent.id}, options);
  },
  mayHaveChildren: function(parent) {
    return parent.hasChildren == true;
  }
}));

When I add or remove items from the store using store.add(...) or store.remove(id), I call grid.refresh.  However, the grid does NOT refresh.  I have to physically refresh the page to have the grid changes reflected.  How do I get the grid to refresh and show the updates?

Thanks,
Harry
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Refreshing a grid with a RequestMemory store

Harry Devine
In reply to this post by Harry Devine
Anyone have any further insight on this?  I wanted to mention that I was able to get the add portion of my logic working.  Since the store is feeding a dgrid with the Tree mixin, I needed to tell the store what the parent element was.  Once I did this, the data showed up in the grid after I called .add.  However, the call to .remove is NOT working.  I am passing it the ID of the element in the grid and the store, yet the grid does not update to reflect the removal.  The data is removed in my database due to my request.post to my PHP script to accomplish this, but in order to see removal in the grid, I have to refresh the entire page.

Please help!  This is the last piece of this project I need to get working before I can turn it over for our users to use.

Thanks,
Harry


From: "Harry Devine" <[hidden email]>
To: [hidden email]
Sent: Wednesday, July 13, 2016 2:26:23 PM
Subject: Re: [Dojo-interest] Refreshing a grid with a RequestMemory store

I wanted to add that dGrid is 0.3.16 and RequestMemory.js is from dojo-smore 0.2.0.  Should I be taking a step back and move to dGrid > 0.4 and use dstore?

Harry

Sent from my iPhone

On Jul 12, 2016, at 11:18 AM, Harry Devine <[hidden email]> wrote:

My dGrid has data fed by a RequestMemory store wrapped in Observable like this:

store = new Observable(new RequestMemory({url: "getData.php",
  getChildren: function(parent, options) {
    return this.query({parent: parent.id}, options);
  },
  mayHaveChildren: function(parent) {
    return parent.hasChildren == true;
  }
}));


When I add or remove items from the store using store.add(...) or store.remove(id), I call grid.refresh.  However, the grid does NOT refresh.  I have to physically refresh the page to have the grid changes reflected.  How do I get the grid to refresh and show the updates?


Thanks,

Harry


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...