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 7912543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:38:17+00:00 2026-06-03T13:38:17+00:00

Hi i have found a lot of examples about loading data from a db

  • 0

Hi i have found a lot of examples about loading data from a db in sencha.
i try to make a list with notes and on second step i want to be able to add(save) a note to my db. i try that on localstorage.

for now i load data from a array in my Arraystore.
where shall i set my proxy? (in store or in model?)

how could i insert data in my store?
i have tried something like that on my current arraystore but with no luck:
(this is the code run by pressing a code):

 MyArrayStore.add({title:"newnote",narrative:"bla bla bla",date:now,id:noteid});
    MyArrayStore.sync();

the browser console gets an error:
Uncaught ReferenceError: MyArrayStore is not defined
shall i make an instance of my store or something?

my model is this:
thanx for the answer. i try that on architect.
my model is this:

Ext.define('MyApp.model.NoteModel', {
    extend: 'Ext.data.Model',
    alias: 'model.NoteModel',
    config: {
        fields: [
            {
                name: 'id',
                type: 'int'
            },
            {
                name: 'date',
                type: 'date'
            },
            {
                name: 'title',
                type: 'string'
            },
            {
                name: 'narrative',
                type: 'string'
            }
        ],
        proxy: {
            type: 'localstorage',
            id: 'local'
        }
    }
});

and my store is this:

Ext.define('MyApp.store.MyArrayStore', {
    extend: 'Ext.data.Store',
    requires: [
        'MyApp.model.NoteModel'
    ],

    config: {
        data: [
            {
                title: 'Note 1',
                narrative: 'test1 1'
            },
            {
                title: 'Note 2',
                narrative: 'narrative 2'
            },
            {
                title: '3 ertyyh',
                narrative: 'narrative 3'
            },
            {
                title: '4 asdf',
                narrative: 'narrative 4'
            },
            {
                title: 'Note 5',
                narrative: 'narrative 5'
            },
            {
                title: 'weadf',
                narrative: 'narrative 6'
            }
        ],
        model: 'MyApp.model.NoteModel',
        storeId: 'MyArrayStore'
    }
});
  • 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-06-03T13:38:20+00:00Added an answer on June 3, 2026 at 1:38 pm

    You should set your proxy in your model OR in your store.
    Here’s how to do it within your model.

    Ext.define('MyModel', {
    
    extend: 'Ext.data.Model',
    
    config: {
        fields: ['field1'],
        proxy: {
            type: 'localstorage',
            id  : 'my-model-localstorage-id'
        }
    });
    

    The same can alternatively be done in your store.

    After that, given that ‘MyArrayStore’ is an instance of such a store, the code you propose should work just fine.

    Hope this helps.

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

Sidebar

Related Questions

I have found a lot of material on the web about using the ASP.NET
I have found a lot of topics about stress-testing web application. My goals are
I have searched a lot about regex and finally I found out that it's
I know try catch have been discussed a lot but I haven’t found a
I saw a lot of examples of CopyStream implementation but I have question about
I'm wondering about functional or non-functional requirements. I have found lot of different definitions
I have read a lot about unit testing, but I still haven't found any
I have been reading a lot about Reinforcement Learning lately, and I have found
I have found a lot of information on using UIImagePickerController to let the user
I've scored the internet for sources and have found a lot of useful information,

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.