1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    7
    Vote Rating
    0
    wizman is on a distinguished road

      0  

    Exclamation 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:
    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)]
    });
    Q2: can i please see a simple code example where i update/reload a store's (specifically used in a NestedList) data?
    this will also be read from the DB and parsed with a 'memory' proxy.

    Thanks
    Nadav

  2. #2
    Sencha User gcallaghan's Avatar
    Join Date
    Apr 2010
    Location
    Cupertino, Ca
    Posts
    247
    Vote Rating
    1
    gcallaghan is on a distinguished road

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    117
    Vote Rating
    9
    Bunchofstring will become famous soon enough

      0  

    Default


    @gcallaghan, your proposal for Q2 did not work for me. Have you come across any working solution since that post?

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    7
    Vote Rating
    0
    wizman is on a distinguished road

      0  

    Default


    @Bunchofstring I've moved everything to using ordinary Lists, everything works great...
    Nadav

  5. #5
    Sencha User
    Join Date
    Nov 2010
    Posts
    117
    Vote Rating
    9
    Bunchofstring will become famous soon enough

      0  

    Default


    @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

  1. Nested Data (AjaxProxy) spread over separated views
    By wrybit in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 28 Nov 2010, 8:00 AM
  2. EXTnd - Spped Issues while accessing data in views
    By Satyen Velankar in forum Ext.nd for Notes/Domino
    Replies: 2
    Last Post: 15 Apr 2009, 9:48 PM
  3. Updating data in TreePanel.
    By Kudzu in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 7 Jan 2009, 9:28 AM
  4. Designing for Complex Data/Complex Views
    By JEBriggs in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 5 May 2008, 12:17 PM
  5. Updating data using a form
    By cadudecastroalves in forum Ext 2.x: Help & Discussion
    Replies: 12
    Last Post: 14 Feb 2008, 11:14 AM

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar