Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6605445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:17:06+00:00 2026-05-25T19:17:06+00:00

If got a sencha touch application, with a login form. For returning users, I

  • 0

If got a sencha touch application, with a login form. For returning users, I would like to store the login credentials in the local storage.

User.js

App.models.User = Ext.regModel('User', {
    fields: [
         {
            name: 'username',
            type: 'string'
        }, {
            name: 'password',
            type: 'string'
        }
    ],

    proxy: {
        type: 'localstorage',
        id: 'p2s-users'
    }
});

Users.js

App.stores.users = new Ext.data.Store({
    model: 'User',
    autoLoad: true
});

Now I try to sync the form values with local storage, how can I do that, what’s the activity flow for reading / getting it?

For reading I would do:

var model = new App.models.User();
users = App.stores.users.load();
if (users.data.length > 0 ) {
   model = users.getAt(0);
 } else {
   App.stores.users.create();
 }
 form.load(model);

Writing:

 form.model.set(form.data);
 form.model.save();
 App.stores.users.sync();

Somehow it looks too complicate to me (and it doesn’t work anyway). How would you solve the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:17:07+00:00Added an answer on May 25, 2026 at 7:17 pm

    First make sure your saving the models right. For example do this:

    var model = new App.models.User();
        model.data.username = 'theUser';
        model.data.password = 'thePass';
        model.save(); //the actual saving. Use chrome developer tools to see the local storage
    

    Then load the model from the localstorage

    users = App.stores.users.load();
    model = users.getAt(0);
    

    Check if the loaded model is OK and load that to the form with load(model)

    The form could be like this:

    new Ext.Application({
    launch: function() {
        new Ext.form.FormPanel({
                id:'theForm',
                fullscreen: true,
                defaults: {
                    labelAlign: 'top',
                    labelWidth: 'auto',
                },
                items: [
                    {
                        id : 'userName',
                        name : 'username',
                        label: 'Email',
                        xtype: 'emailfield',
                    },
                    {
                        id : 'userPassword',
                        name: 'password',
                        label: 'Password',
                        xtype: 'passwordfield',
                    }
                 ]
            });
         }
    });
    

    Then load the record like this Ext.getCmp('theForm').load(users.getAt(0));

    To get the model from the form: Ext.getCmp('theForm').getRecord();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to include sencha touch in my android project. Does anyone got
In my sencha-touch application, I've got a FormPanel that is supposed to post to
Got a simple question. I would like to get a drop down menu value
Hi guys I'm running through this tutorial: http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap and trying to get the code
I've got a sencha touch app, with a panel that contains 3 image buttons,
Got an application wich read some infos in a specific XML file. I would
I've got a Sencha Touch MVC app that I'm trying to write some tests
I am writing a Sencha Touch app where user will download 5000 records in
Got an interesting scenario I'd like to run past you guys re: DB architecture.
got a small problem, this code <form action=<?php echo $_SERVER['PHP_SELF']; ?> method=post> <?php ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.