Next, we will create the menu that is going to list the folders of Inbox, as demonstrated in the following screenshot:
As usual, we will start with the model and store. As we will use the NodeInterface
class to represent each node
(which is the default class), we will not need any customization—we do not need to declare the model; we can skip directly to the tree store:
Ext.define('Packt.store.mail.MailMenu', { extend: 'Ext.data.TreeStore', clearOnLoad: true, proxy: { type: 'ajax', url: 'php/mail/mailMenu.php', } });
We will be loading the JSON from the server. The PHP code is very simple and it returns the JSON we need, which is already hardcoded in a string:
<?php echo '[{ "text": "Inbox", "iconCls": "folder-inbox", "leaf": true },{ "text": "Sent", "iconCls": "folder-sent", "leaf": true },{ "text": "Draft", "iconCls": "folder-drafts", "leaf": true },{ "text": "Trash...