Ext.menu.Manager.hideAll();
This will hide all open menus.
Thoughts and code examples concerning ExtJS, .Net, Javascript and Ajax.
Ext.menu.Manager.hideAll();
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
// Customers table (dataset is 'dsCustomers' as found in the ...Designer.cs file)
m_customer = new dsCustomers.TblCustomers();
//Create data adapter and fill from the source table
(new dsCustomersTableAdapters.TblCustomersTableAdapter()).Fill(m_customer );
m_customer.Rows.Add(m_customer.NewRow()); // Add a blank row
// Likewise for Address table (more verbose)
m_Addresses= new dsCustomers.TblAddresses();
dsCustomersTableAdapters.TblAddressesTableAdapter tblAdap = new dsCustomersTableAdapters.TblAddressesTableAdapter();
tblAdap.Fill(m_Addresses);
DataRow dr = m_Addresses.NewRow(); // generate a new row
m_Addresses.Rows.Add(dr); // append back to the table
base.OnStartup(e);
}
private dsCustomers.TblCustomers m_customer ;
public dsCustomers.TblCustomers Customers
{
get
{
return m_customer ;
}
}
private dsCustomers.TblAddresses m_Addresses;
public dsCustomers.TblAddresses Addresses
{
get
{
return m_Addresses;
}
}
}
< Grid.Resources>
< xcdg:DataGridCollectionViewSource
x:Key="Tblmycustomers"
Source="{Binding Source={x:Static Application.Current},
Path= Customers}"/ >
< xcdg:DataGridCollectionViewSource
x:Key="TblLocations"
AutoCreateForeignKeyDescriptions="true"
Source="{Binding Source={x:Static Application.Current},
Path= Addresses}"/ >
< /Grid.Resources >
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
// ----------- Base class (extending 'object' ) ------------------
genericBase = Ext.extend(Object, {
basevar1: 1,
constructor: function(args) {
this.basevar1 = 2;
},
baseFunc1: function(testArg) {
alert("test Arg is " + testArg + " basevar = " + this.basevar1);
}
});
// ----------- Derived class (extending 'genericBase'class ) -------
genericDerived = Ext.extend(genericBase, {
derVar: 444, // class property
constructor: function(args) {
// Call the base constructor
genericDerived.superclass.constructor.call(this, args);
},
derivedFunc1: function(testArg) {
alert("derivedFunc1 called " + testArg );
},
getBaseval: function() {
return this.basevar1;
}
});
// -------- Code to instantiate and test the classes
// First, create the object
var myobj = new genericDerived({prop1: '123', prop2: 'abc' });
// displays basevar with a get method
alert("Derived class, method call ==>" + myobj.getBaseval());
// also displays basevar, but with direct property reference
alert("explicit reference to property basevar1 ==> " + myobj.basevar1);
myobj.baseFunc1('Calling base method');
myobj.derivedFunc1('Calling derived class method');
var mydom = Ext.get('mydomelement'); // get element
var tip = Ext.getCmp(mydom.dom.id + '_tip'); //get element's tooltip
if ( tip ) {// tool tip already exists, so modify
tip.title = 'new title';
tip.html = 'new text';
}
else { // tip does not exist. Create it with unique id.
new Ext.ToolTip({
target: mydom.dom.id,
id: mydom.dom.id + '_tip',
title: 'title here', html: 'original text'
});
}
I am giving every tooltip a unique id, based on the id of the dom element it decorates.
/// < reference path="lib/ext/adapter/ext/ext-base.js">
/// < reference path="lib/ext/ext-all-debug.js">
/// < reference path="myotherfile.js">