これらのボタンにハンドラを割り付けてメインタブパネルにタブが追加表示されるようにしたつもりだが、正常に表示できていない。原因不明。てかよく分かってないのが原因。
また、不要なファイルを削除。
'user.Edit',
'platform.Top',
'platform.Navigator',
- 'platform.MainTabs'
+ 'platform.MainTabs',
+ 'menu.List',
+ 'menu.Entry'
],
stores: [
- 'Users'
+ 'Users',
+ 'MenuItems'
],
models: [
- 'User'
+ 'User',
+ 'MenuItem'
],
init: function() {
},
'useredit button[action=save]': {
click: this.updateUser
+ },
+ 'menuentry': {
+ click: this.showMenu
}
}
);
record.set(values);
win.close();
this.getUsersStore().sync();
+ },
+
+ showMenu: function(entry) {
+ console.log('clicked the ShowMenu button { text: ' + entry.text + ', id:' + entry.id + '}');
+ var tabs = Ext.widget('platformmain');
+ console.log('tabs=' + tabs);
+ //tabs.showTab(entry);
+ tabs.addTab();
}
}
);
\ No newline at end of file
--- /dev/null
+Ext.define(
+ 'Decshee.model.MenuItem',
+ {
+ extend: 'Ext.data.Model',
+ fields: ['name', 'id']
+ }
+);
\ No newline at end of file
--- /dev/null
+Ext.define(
+ 'Decshee.store.MenuItems',
+ {
+ extend: 'Ext.data.Store',
+ model: 'Decshee.model.MenuItem',
+ autoLoad: true,
+
+ proxy: {
+ type: 'ajax',
+ api: {
+ read: 'data/menuitems.json',
+ update: 'data/updateUsers.json'
+ },
+
+ reader: {
+ type: 'json',
+ root: 'users',
+ successProperty: 'success'
+ }
+
+ }
+ }
+);
\ No newline at end of file
proxy: {
type: 'ajax',
- //url: 'data/users.json',
- api: {
- read: 'data/users.json',
- update: 'data/updateUsers.json'
- },
+ url: 'data/users.json',
+ // api: {
+ // read: 'data/users.json',
+ // update: 'data/updateUsers.json'
+ // },
reader: {
type: 'json',
+++ /dev/null
-// ------------------------------
-// トップパネル
-// ------------------------------
-Ext.define(
- 'Decshee.view.core.Top',
- {
- extend: 'Ext.Panel',
- alias: 'widget.top',
- defaults: {
- border: false
- },
- initComponent: function() {
- var me = this;
- Ext.apply(
- me,
- {
- html:'<h1>Decshee Groupware</h1>',
- margins:'5 5 0 5',
- region:'north',
- split:true,
- items: [
- ]
- }
- );
-
- this.callParent(arguments);
- }
- }
-);
-
-// ------------------------------
-// メインタブパネル
-// ------------------------------
-Ext.define(
- 'Decshee.view.core.Main',
- {
- extend: 'Ext.tab.Panel',
- alias: 'widget.main',
- defaults: {
- border: false
- },
- initComponent: function() {
- var me = this;
- Ext.apply(
- me,
- {
- activeTab: 0,
- margins:'0 5 5 0',
- region:'center',
- index: 0,
- items: [
- {
- id: 'home',
- title: 'ホーム',
- html: '<h1>ホームタブ</h1>'
- }
- ]
- }
- );
-
- this.callParent(arguments);
- },
- add: function() {
- var me = this;
- ++me.index;
- me.add(
- {
- title: 'New Tab ' + me.index,
- iconCls: 'tabs',
- html: '<h1>生成されたタブ' + me.index + 'です</h1>',
- closable: true
- }
- ).show();
- }
- }
-);
-
-// ------------------------------
-// ナビゲーションパネル
-// ------------------------------
-Ext.define(
- 'Decshee.view.core.Navigator',
- {
- extend: 'Ext.Panel',
- alias: 'widget.navigator',
- defaults: {
- border: false
- },
- initComponent: function() {
- var me = this;
- Ext.apply(
- me,
- {
- title: 'ナビゲータ',
- margins: '0 0 5 5',
- width: 200,
- collapsible: true,
- region: 'west',
- split: true,
- layout: 'accordion',
- bitems: [
- {
- title: 'お気に入り',
- html: '<h1>業務関連へのリンクを表示する予定。<h1>',
- iconCls: 'nav'
- },
- {
- title: '検索',
- html: '<h1>検索とか。<h1>',
- iconCls: 'nav'
- },
- {
- title: '管理業務',
- iconCls: 'settings',
- layout: {
- type: 'vbox',
- padding: 5,
- align: 'stretch'
- },
- items: [
- {
- xtype: 'button',
- text: '社員情報',
- margins: '0 0 5 0',
- handler: function() {
- showTab();
- }
- },
- {
- xtype: 'button',
- text: '組織情報',
- margins: '0 0 5 0',
- handler: function() {
- showTab();
- }
- },
- {
- xtype: 'button',
- text: '権限情報',
- margins: '0 0 5 0',
- handler: function() {
- showTab();
- }
-
- }
- ]
- }
- ]
- }
- );
-
- this.callParent(arguments);
- }
- }
-);
+++ /dev/null
-// ------------------------------
-// トップパネル
-// ------------------------------
-Ext.define(
- 'Decshee.view.core.Top',
- {
- extend: 'Ext.Panel',
- alias: 'widget.top',
- defaults: {
- border: false
- },
- initComponent: function() {
- var me = this;
- Ext.apply(
- me,
- {
- html:'<h1>Decshee Groupware</h1>',
- margins:'5 5 0 5',
- region:'north',
- split:true,
- items: [
- ]
- }
- );
-
- this.callParent(arguments);
- }
- }
-);
-
-// ------------------------------
-// メインタブパネル
-// ------------------------------
-Ext.define(
- 'Decshee.view.core.Main',
- {
- extend: 'Ext.tab.Panel',
- alias: 'widget.main',
- defaults: {
- border: false
- },
- initComponent: function() {
- var me = this;
- Ext.apply(
- me,
- {
- activeTab: 0,
- margins:'0 5 5 0',
- region:'center',
- index: 0,
- items: [
- {
- id: 'home',
- title: 'ホーム',
- html: '<h1>ホームタブ</h1>'
- }
- ]
- }
- );
-
- this.callParent(arguments);
- },
- add: function() {
- var me = this;
- ++me.index;
- me.add(
- {
- title: 'New Tab ' + me.index,
- iconCls: 'tabs',
- html: '<h1>生成されたタブ' + me.index + 'です</h1>',
- closable: true
- }
- ).show();
- }
- }
-);
-
-// ------------------------------
-// ナビゲーションパネル
-// ------------------------------
-Ext.define(
- 'Decshee.view.core.Navigator',
- {
- extend: 'Ext.Panel',
- alias: 'widget.navigator',
- defaults: {
- border: false
- },
- initComponent: function() {
- var me = this;
- Ext.apply(
- me,
- {
- title: 'ナビゲータ',
- margins: '0 0 5 5',
- width: 200,
- collapsible: true,
- region: 'west',
- split: true,
- layout: 'accordion',
- items: [
- {
- title: 'お気に入り',
- html: '<h1>業務関連へのリンクを表示する予定。<h1>',
- iconCls: 'nav'
- },
- {
- title: '検索',
- html: '<h1>検索とか。<h1>',
- iconCls: 'nav'
- },
- {
- title: '管理業務',
- iconCls: 'settings',
- layout: {
- type: 'vbox',
- padding: 5,
- align: 'stretch'
- },
- items: [
- {
- xtype: 'button',
- text: '社員情報',
- margins: '0 0 5 0',
- handler: function() {
- showTab();
- }
- },
- {
- xtype: 'button',
- text: '組織情報',
- margins: '0 0 5 0',
- handler: function() {
- showTab();
- }
- },
- {
- xtype: 'button',
- text: '権限情報',
- margins: '0 0 5 0',
- handler: function() {
- showTab();
- }
-
- }
- ]
- }
- ]
- }
- );
-
- this.callParent(arguments);
- }
- }
-);
--- /dev/null
+Ext.define(
+ 'Decshee.view.menu.Entry',
+ {
+ extend: 'Ext.Button',
+ alias : 'widget.menuentry',
+ //store : 'MenuItem',
+ margins: '0 0 5 0',
+ id: ''
+ //renderTo: Ext.getBody(),
+ //initComponent: function() {
+ // this.callParent(arguments);
+ //}
+ }
+);
\ No newline at end of file
--- /dev/null
+Ext.define(
+ 'Decshee.view.menu.List',
+ {
+ extend: 'Ext.panel.Panel',
+ alias : 'widget.menulist',
+ title: 'メンテナンス業務',
+ iconCls: 'settings',
+ store : 'MenuItems',
+ layout: {
+ type: 'vbox',
+ padding: 5,
+ align: 'stretch'
+ },
+ items: [
+ {
+ xtype: 'menuentry',
+ text: '社員情報',
+ id: 'Member'
+ },
+ {
+ xtype: 'menuentry',
+ text: '組織情報',
+ id: 'Belonging'
+ },
+ {
+ xtype: 'menuentry',
+ text: '権限情報',
+ id: 'Role'
+ }
+ ],
+
+ initComponent: function() {
+ this.callParent(arguments);
+ }
+ }
+);
\ No newline at end of file
index: 0,
items: [
{
- id: 'home',
+ itemId: 'home',
title: 'ホーム',
html: '<h1>ホームタブ</h1>'
}
},
addTab: function() {
+ console.log('[START]tabs.addTab');
var me = this;
++me.index;
me.add(
closable: true
}
).show();
+ console.log('[ END ]tabs.addTab');
+ },
+
+ showTab: function(entry) {
+ var me = this;
+ me.add(
+ {
+ title: entry.text,
+ //itemId: entry.id,
+ iconCls: 'tabs',
+ html: '<h1>生成された' + entry.text + 'タブです</h1>',
+ closable: true
+ }
+ ).show();
}
}
);
\ No newline at end of file
layout: 'accordion',
// TODO items群はここに定義すべきではない。動的にどこかから持ってくるのが正しい。
items: [
- {
- title: 'お気に入り',
- html: '<h1>業務関連へのリンクを表示する予定。<h1>',
- iconCls: 'nav'
- },
- {
- title: '検索',
- html: '<h1>検索とか。<h1>',
- iconCls: 'nav'
- },
- {
- title: '管理業務',
- iconCls: 'settings',
- layout: {
- type: 'vbox',
- padding: 5,
- align: 'stretch'
- },
- items: [
- {
- xtype: 'button',
- text: '社員情報',
- margins: '0 0 5 0'
- // handler: function() {
- // showTab();
- // }
- },
- {
- xtype: 'button',
- text: '組織情報',
- margins: '0 0 5 0'
- // handler: function() {
- // showTab();
- // }
- },
- {
- xtype: 'button',
- text: '権限情報',
- margins: '0 0 5 0'
- // handler: function() {
- // showTab();
- // }
- }
- ]
- }
+ { xtype: 'menulist' },
+ {
+ title: 'お気に入り',
+ html: '<h1>業務関連へのリンクを表示する予定。<h1>',
+ iconCls: 'nav'
+ },
+ {
+ title: '検索',
+ html: '<h1>検索とか。<h1>',
+ iconCls: 'nav'
+ }
]
}
);
\ No newline at end of file
--- /dev/null
+{
+ success: true,
+ users: [
+ { name: '社員情報', id: 'member'},
+ { name: '組織情報', id: 'belonging'},
+ { name: '権限情報', id: 'role'}
+ ]
+}
\ No newline at end of file
--- /dev/null
+../ext-4.0.0/
\ No newline at end of file