title: How to save the notes in local storage in sencha touch?
body: <p>I have followed the tutorial  : <a href="http://miamicoder.com/2011/writing-a-sencha-touch-application-part-3/" rel="nofollow">http://miamicoder.com/2011/writing-a-sencha-touch-application-part-3/</a>  </p>
  
  <p>to add and save notes. But save note is not working for me. What is the issue??  </p>
  
  <p>My code to save :  </p>
  
  <pre><code> NotesApp.views.noteEditorTopToolbar = new Ext.Toolbar({  
             title: 'Edit Note', 
              items: [
  
                   { xtype: 'spacer' },
                   {
                       text: 'Save',  
                       ui: 'action',  
                       handler: function () {  
                           // TODO: Save current note.  
  
                         var noteEditor = NotesApp.views.noteEditor;
  
                      var currentNote = noteEditor.getRecord();  
  
                  // Update the note with the values in the form fields.
                  noteEditor.updateRecord(currentNote);  
  
                //var errors = currentNote.validate();
                /*if (!errors.isValid()) {
                  currentNote.reject();
                  Ext.Msg.alert('Wait!', errors.getByField('title')[0].message, Ext.emptyFn);
                  return;
              }*/
  
                 var notesList = NotesApp.views.notesList;  
  
  
                   var notesStore = notesList.getStore();  
  
  
  
  
  
  
                if (notesStore.findRecord('id', currentNote.data.id) === null) {  
                   alert('fjghjkh');  
                  notesStore.add(currentNote);  
              } else {  
                   alert('fjghjkh');  
                  currentNote.setDirty(); 
              }  
  
              notesStore.sync();  
  </code></pre>
  
  <p>notesStore.sort([{ property: 'date', direction: 'DESC'}]);  </p>
  
  <pre><code>            notesList.refresh();  
  
              NotesApp.views.viewport.setActiveItem('notesListContainer', {   type: 'slide', direction: 'right' });  
  
            }  
  </code></pre>
  
  <p>thanks<br>
  Sneha</p>