-
9 Jun 2010 3:37 PM #41
Hi,
I'm using Ext.Direct for my DB calls, as in
Is there anyway to use directFN with this great little menu of yours?Code:var storeAccounts = new Ext.data.DirectStore({ storeId:'storeAccounts', // Loading configuration autoLoad: true, directFn: Ext.PromotionBot.Accounts.getAccounts,
Regards,
Andy
-
9 Jun 2010 9:36 PM #42
StoreMenu supports an own store as config item, so you might try something like
PHP Code:var menu = new Ext.ux.menu.StoreMenu({
store: storeAccounts
});
Extensions:
Ext.ux.DatePickerPlus (Multimonth,Multiselect,...)
Ext.ux.menu.StoreMenu - Ajax Store as menu-item config
Extended Window - Aero Shadows, nested grayscaled modal windows
Ext.MessageBox.promptCombo/promptRadio/promptCheckbox
Ext.ux.plugin.triggerfieldTooltip (for Comboboxes, Datefields...)
Ext.util.MD5
Ext.util.Utf8 (encode/decode)
Ext.util.base64 (encode/decode)
Using:
ExtJS 3.4.1.1/4.2
XPsp3/W7sp1
IE8/9/10
FF 20
Chrome 26
-
15 Dec 2010 1:35 PM #43
Can you add your menu to a splitbutton.
PHP Code:xtype: 'splitbutton',
text: 'Group',
id: 'groupButton',
menu:buttonmenu,
var buttonmenu = new Ext.ux.menu.StoreMenu({
store:mainStore,
});
var mainStore = new Ext.data.Store({
// explicitly create reader
reader: new Ext.data.JsonReader({
idProperty: 'groupid',
root: 'groups',
fields: [
{name: 'label'},
{name: 'test'},
]
})
});
-
3 Mar 2011 2:29 AM #44
Iconcls don't show any icons
Iconcls don't show any icons
Hello,
I try to set some icon class on Store menu json as is:
where exclamation class is defined on external css as is :PHP Code:{
"text": "normal menu line",
"iconcls": "exclamation",
"handler": "function(item) {Ext.MessageBox.alert('Ext.ux.menu.StoreMenu','You selected '+item.text);}"
},
The image was present on correct path and css file is linked on my html test page.PHP Code:...
.exclamation { background-image: url(../icons/exclamation.png) !important; }
...
Any suggestion ?
Thank you, regards
-
3 Mar 2011 6:47 AM #45
Try "iconCls" instead of "iconcls" it's case sensitive
Extensions:
Ext.ux.DatePickerPlus (Multimonth,Multiselect,...)
Ext.ux.menu.StoreMenu - Ajax Store as menu-item config
Extended Window - Aero Shadows, nested grayscaled modal windows
Ext.MessageBox.promptCombo/promptRadio/promptCheckbox
Ext.ux.plugin.triggerfieldTooltip (for Comboboxes, Datefields...)
Ext.util.MD5
Ext.util.Utf8 (encode/decode)
Ext.util.base64 (encode/decode)
Using:
ExtJS 3.4.1.1/4.2
XPsp3/W7sp1
IE8/9/10
FF 20
Chrome 26
-
11 Apr 2011 1:55 AM #46
StoreMenu with new features
StoreMenu with new features
Hi all,
I have modified the original version StoreMenu and added several new features. As I need them in my project.
- Able to define handler from the client side
- Added function and modified StoreMenu can be used to display both menu items from Store and other components
- Dis/Enable to load from Store every time when the menu is expanded.
For usage and getting the source, click here
Thanks
Joe
-
12 Apr 2011 4:14 AM #47
I've modified the original code, so that items get automatically turned into StoreMenus if they have the "menuId" attribute set:
Code:Ext.namespace('Ext.ux.menu'); Ext.ux.menu.StoreMenu = function(config) { Ext.ux.menu.StoreMenu.superclass.constructor.call(this,config); this.baseParams = config.baseParams || {}; if(!this.store){ //at least url/proxy or data need to be given in config when initiating this component this.store = new Ext.data.SimpleStore({ fields: ['config'], url: this.url, baseParams: this.baseParams /*, proxy:this.proxy, data: this.data */ }); } // Keep track of what menu items have been added this.storeMenus = []; if (this.itemsOffset === undefined) { this.itemsOffset = 0; } this.on('show', this.onMenuLoad, this); this.store.on('beforeload', this.onBeforeLoad, this); this.store.on('load', this.onLoad, this); }; Ext.extend(Ext.ux.menu.StoreMenu, Ext.menu.Menu, { loadingText: Ext.LoadMask.prototype.msg || 'Loading...', loaded: false, onMenuLoad: function(){ if(!this.loaded || this.autoReload){ //if(this.options) { //this.store.loadData(this.options); //} //else { this.store.load(); //} } }, updateMenuItems: function(loadedState,records) { //var visible = this.isVisible(); //this.hide(false); for (var i = 0; i < this.storeMenus.length; i++) { this.remove(this.storeMenus[i]); } this.storeMenus = []; //to sync the height of the shadow this.el.sync(); if (loadedState) { for(var i=0, len=records.length; i<len; i++){ //create a real function if a handler or menu is given as a string (because a function cannot really be encoded in JSON if (records[i].json.handler) { eval("records[i].json.handler = "+records[i].json.handler); //records[i].json.handler = new Function(records[i].json.handler); } else if (this.itemsHandler) { records[i].json.handler = this.itemsHandler; } if (records[i].json.menu) { eval("records[i].json.menu = "+records[i].json.menu); //records[i].json.menu = new Function(records[i].json.menu); } //console.log([this, records[i]]); if (records[i].json.menuId) { records[i].json.menu = new Ext.ux.menu.StoreMenu({ url: this.initialConfig.url, menuId: records[i].json.menuId }); } this.storeMenus.push(this.insert(this.itemsOffset + i, records[i].json)); } //this.hide(); //this.show(); } else { this.storeMenus.push(this.insert(this.itemsOffset + i,'<span class="loading-indicator">' + this.loadingText + '</span>')); } this.loaded = loadedState; //if(visible && loadedState) { //this.show(this.getEl().getXY()); //this.show(); //} }, onBeforeLoad: function(store){ this.store.baseParams = this.baseParams; this.store.baseParams.menuId = this.menuId; this.updateMenuItems(false); }, onLoad: function(store, records){ this.updateMenuItems(true,records); }, setItemsHandler: function(handler) { this.itemsHandler = handler; }, setOffset: function(offset) { this.itemsOffset = offset; }, setAutoReload: function(autoReload) { this.autoReload = autoReload; } });
-
15 Jun 2011 7:52 AM #48
Adding this widget.
Adding this widget.
I've got a n00b question. How do I add this wonderful widget to my current project. Thanks guys.
-
16 Aug 2011 9:49 PM #49
Extensions:
Ext.ux.DatePickerPlus (Multimonth,Multiselect,...)
Ext.ux.menu.StoreMenu - Ajax Store as menu-item config
Extended Window - Aero Shadows, nested grayscaled modal windows
Ext.MessageBox.promptCombo/promptRadio/promptCheckbox
Ext.ux.plugin.triggerfieldTooltip (for Comboboxes, Datefields...)
Ext.util.MD5
Ext.util.Utf8 (encode/decode)
Ext.util.base64 (encode/decode)
Using:
ExtJS 3.4.1.1/4.2
XPsp3/W7sp1
IE8/9/10
FF 20
Chrome 26
-
5 Jun 2012 8:24 AM #50
someone could send some sources in extjs4 example implementation. thanks


Reply With Quote