May 04, 2009, 10:07 AM
MenuItems and tooltips
Hi
My webapp is in production on our intranet and it's working great
Atm I am messing around with minor updates to give the users a better experinece using the the webapp
I have added some keymaps using same clientside code as buttons etc
I want to add some tooltips also bot to explain a little about the functionality both also to give the user some knowledge about possible keystrokes
This is also working to a degree :)
But what about menuitems and tooltips?
I have some codebehind like this
// Filter - apply button
ext.ToolTip _toolTip = new ext.ToolTip();
ext.SplitButton _btnFilter = new ext.SplitButton();
_btnFilter.ID = "btnFilter";
_btnFilter.Text = "Set Filter";
_btnFilter.Icon = ext.Icon.Cog;
// tooltip is working ok
_toolTip.Title = "Filter";
_toolTip.Html = "Sæt filter (Ctrl-Shift-F)";
_btnFilter.ToolTips.Add(_toolTip);
// We need to check if the data has been edited
// Notify user and cancel click event if this is the case
_btnFilter.Listeners.Click.Handler = Scripts.DataGrid.SetFilter();
_btnFilter.AjaxEvents.Click.Event +=
new Coolite.Ext.Web.ComponentAjaxEvent.AjaxEventHandler(btnFilter_Click);
_btnFilter.AjaxEvents.Click.Failure = Scripts.Messages.AjaxErrorLoad();
_btnFilter.AjaxEvents.Click.EventMask.ShowMask = true;
_btnFilter.AjaxEvents.Click.EventMask.RemoveMask = false;
_btnFilter.AjaxEvents.Click.EventMask.Msg = "Sætter filter, et øjeblik ...";
// Filter - remove submenu
ext.Menu _menu = new ext.Menu();
ext.MenuItem _menuItem = new ext.MenuItem();
_menuItem.ID = "mnuRemoveFilter";
_menuItem.Icon = ext.Icon.CogDelete;
_menuItem.Text = "Fjern Filter";
// tooltip (not working)
_toolTip.Title = "Filter";
_toolTip.Html = "Fjern filter (Ctrl-Alt-F)";
_menuItem.ToolTips.Add(_toolTip);
_menuItem.AjaxEvents.Click.Event +=
new Coolite.Ext.Web.ComponentAjaxEvent.AjaxEventHandler(mnuRemoveFilter_Click);
_menuItem.AjaxEvents.Click.Failure = Scripts.Messages.AjaxErrorLoad();
_menuItem.AjaxEvents.Click.EventMask.ShowMask = true;
_menuItem.AjaxEvents.Click.EventMask.RemoveMask = false;
_menuItem.AjaxEvents.Click.EventMask.Msg = "Fjerner filter, et øjeblik ...";
_menu.Items.Add(_menuItem);
_btnFilter.Menu.Add(_menu);
// _btnFilter.StandOut = true; // not available
_toolbar.Items.Add(_btnFilter);
In the clientside extjs scripts this function is unable to retreive "this.target" - value is nullinitTarget : function(){
if(this.target){
this.target = Ext.get(this.target);
this.target.on('mouseover', this.onTargetOver, this);
this.target.on('mouseout', this.onTargetOut, this);
this.target.on('mousemove', this.onMouseMove, this);
}
},
Not possible or am I doing something "wrong"?Thanks in advance