The framework provides an
The settings which you display can potentially be long and complicated, divided up into multiple sections or even multiple pages. A simple example is as follows:
Framework.AskSettings([
{type: "int", caption: "A number field", value: 23},
{type: "text", caption: "A text field", value: "Some text"},
{type: "instrumentId", caption: "A market", value: "GBP/USD"},
{type: "list", caption: "A list of options", value: "value2", options: [
{k: "value1", v: "Option 1"},
{k: "value2", v: "Option 2"}
]}
], function (MsgResult) {
…
});
Each individual field in the settings can have the following properties:
| Property | Description |
| id | Optional, but helps to identify the field when you receive the results back from the dialog |
| caption | Label to display next to the field |
| type | Type of field: one of |
| value | Initial value to pre-populate into the field: For a chart For a For a |
| options | Only used for a |
The configuration which you pass into
An array of fields, as in the example above
An object with a
An object with a
An object with a
If you pass an object rather than a bare array, then you can set a
Passing an object with a
Framework.AskSettings({
sections: [
{
caption: "Section 1",
fields: [
{type: "int", caption: "A number field", value: 17},
]
}, {
caption: "Section 2",
fields: [
{type: "int", caption: "Another number field", value: 46},
]
}
]
}, function (MsgResult) {
…
});
Your settings can even be split up into multiple pages; a
What you get back in your asynchronous callback function depends on the input you provide. The
If the user saves the settings, then you will receive one of the following inside the
A
A
Or, just a