The user can choose to take any widget in the MyTrader page container and pop it out into a new browser window. You can copy the settings from the existing widget into the new window using a mechanism very similar to, and often related to,
You need to handle
Framework.OnGetState = function()
{
return {
instrumentId: "EUR/USD",
timeframe: 3600,
visualOptions: {
color: "blue"
}
};
}
The new pop-up browser window will receive this stored state in its
As a result, it's very common for a widget's storage of private settings and its handling of
The widget uses
When saving private settings as a result of a user change, the widget calls its own
For example:
// Build some representation of the widget's state. This is returned both internally
// and to the framework when opening a new window.
Framework.OnGetState = function() {
var settings = { … };
return settings;
};
// Private internal function which our widget calls whenever the user makes a change
// and new settings need to be saved. We simply re-use OnGetState() as a way
// of getting the current state.
Framework.$SaveMySettings = function() {
Framework.SavePrivateSettings(Framework.OnGetState());
}
Note: