SHARE
TWEET

Untitled

a guest Feb 19th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Ext.define("NotesApp.view.NotesList", {
  2.     extend: "Ext.Container",
  3.     requires:"Ext.dataview.List",
  4.     alias: "widget.noteslistview",
  5.  
  6.     config: {
  7.         layout: {
  8.             type: 'fit'
  9.         },
  10.         items: [{
  11.             xtype: "toolbar",
  12.             title: "My Notes",
  13.             docked: "top",
  14.             items: [
  15.                 { xtype: 'spacer' },
  16.                 {
  17.                     xtype: "button",
  18.                     text: 'New',
  19.                     ui: 'action',
  20.                     itemId: "newButton"
  21.                 }
  22.             ]
  23.         }, {
  24.             xtype: "list",
  25.             store: "Notes",
  26.             itemId:"notesList",
  27.             loadingText: "Loading Notes...",
  28.             emptyText: '<div class="notes-list-empty-text">No notes found.</div>',
  29.             onItemDisclosure: true,
  30.             grouped: true,
  31.             itemTpl: '<div class="list-item-title">{title}</div><div class="list-item-narrative">{narrative}</div>'
  32.         }],
  33.         listeners: [{
  34.             delegate: "#newButton",
  35.             event: "tap",
  36.             fn: "onNewButtonTap"
  37.         }, {
  38.             delegate: "#notesList",
  39.             event: "disclose",
  40.             fn: "onNotesListDisclose"
  41.         }]
  42.     },
  43.     onNewButtonTap: function () {
  44.         console.log("newNoteCommand");
  45.         this.fireEvent("newNoteCommand", this);
  46.     },
  47.     onNotesListDisclose: function (list, record, target, index, evt, options) {
  48.         console.log("editNoteCommand");
  49.         this.fireEvent('editNoteCommand', this, record);
  50.     }
  51. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top