-
4 Jan 2011 10:55 AM #1
Updating data and views
Updating data and views
Hello,
I am working on an iPhone offline App (all is data cached in the local SQLite and all files are manifested).
All of the panels and other Ext elements are created, displayed and handled perfectly.
Sencha had really been a pleasure.
I'm having trouble with handling events and updating data structures.
Q1: how do i update a panel with new information?
I have a panel with various panels in it (buttons, textFields, html etc...), i want some new data to be saved to the db (have that part covered) and that this entire panel will be reloaded again with the new data.
pseudo code:
Q2: can i please see a simple code example where i update/reload a store's (specifically used in a NestedList) data?Code:function getPanel(data) { ... // prepare this panel according to the data ... id: 'updateMePanel'; items: [ someButtonHandler: function() { // save stuff to the local DB, read/set new data to newData mainPanel.update('updateMePanel', getPanel(newData)); // or mainPanel.remove('updateMePanel'); mainPanel.add(getPanel(newData)); } ] } var mainPanel = new Ext.Panel({ ... items:[getPanel(data)] });
this will also be read from the DB and parsed with a 'memory' proxy.
ThanksNadav
-
5 Jan 2011 10:35 AM #2
Q1 I think your looking for doComponetLayout(). Also you might want to take a look at Ext.Dataview. This is bound to a store and should update when that store fires a datachanged event.
Q2 I think your looking for a TreeStore with a WebStorage proxy and the TreeStore's sync() method
*note I haven't done this yet
see my comment here for an example of using a treestore with a nested list. I think if you modify it to use a web storage proxy you can use the sync() method to update/reload a store data. Also, I *believe* that when you modify a model that is a member of the store, it should fire the data changed event and update the list automatically.
-
6 Feb 2011 12:49 PM #3
@gcallaghan, your proposal for Q2 did not work for me. Have you come across any working solution since that post?
-
22 Mar 2011 12:10 AM #4
@Bunchofstring I've moved everything to using ordinary Lists, everything works great...
Nadav
-
23 Mar 2011 8:19 PM #5
@wizman, I just wish there was a way to update nested lists bound to a store. Even better would be a way to bind the list to a different store. I've put days of time into this particular issue and I'm giving up for now. Hopefully someone more clever than I will figure out a way to do that.
Similar Threads
-
Nested Data (AjaxProxy) spread over separated views
By wrybit in forum Sencha Touch 1.x: DiscussionReplies: 0Last Post: 28 Nov 2010, 8:00 AM -
EXTnd - Spped Issues while accessing data in views
By Satyen Velankar in forum Ext.nd for Notes/DominoReplies: 2Last Post: 15 Apr 2009, 9:48 PM -
Updating data in TreePanel.
By Kudzu in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 7 Jan 2009, 9:28 AM -
Designing for Complex Data/Complex Views
By JEBriggs in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 5 May 2008, 12:17 PM -
Updating data using a form
By cadudecastroalves in forum Ext 2.x: Help & DiscussionReplies: 12Last Post: 14 Feb 2008, 11:14 AM


Reply With Quote