-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to initialize a widget #222
Comments
Hi @freuh, yep for the moment the easiest solution to pass options to a widget is through the data attributes. Another way to use the options hash is to declare default values for your options in the widget itself (I just merged #212 into master). You now can declare your widget like that :
You should be able to start widgets the same way we did it in previous aura : by calling this.sandbox.start(list) where list is a array of widgets to start (be to be true, i never used it). If you have more complex needs, could you provide a more complete example ? I don't really understand your question about registerWidgetSource... this method is used to declare a new endpoint (or source) to load widgets. About the google group, (I think) I created it a few weeks ago. But never really used it. |
If you want to set some global settings for certain widgets, you could also use the per-module configuration feature of RequireJS. Suppose the path of your widget is requirejs.config({
// The usual path, shim etc. configuration
config: {
myWidget: {
foo: 1,
bar: 2
}
}
}); Then, in your widget, include the special "module" module and access the configuration like this: define([ "module" ], function (module) {
var config = module.config();
// config.foo === 1
// config.bar === 2
}); |
Hi everyone.
I want to find a way to initialize a widget by passing a data object.
Thanks to the video, we can see how we can pass a parameter from the html in order to retrieve it in the widget.
HTML
Widget
Great, but if I have more than only one parameters… Do I have to declare all parameters into the html ?
And if I have a widget in the widget template, do I have to pass the parameter throw the 'parent' widget:
HTML
Toolbar Template
Navigation Widget
I probably missed something...
Is it wrong to add an option parameter when we declare a widget with registerWidgetsSource.
In this way, we just have to declare the widget without passing parameters.
Maybe such a method already exists but I didn't find it.
I have another question: where can we post questions about aura? If I don’t propose something different or don’t add new features, I don't know where we can post questions about Aura.
Do you prefer that everyone opens an issue to regroup all questions?
Do you prefer that everyone use the file question of aura drive folder? Or do you prefer to open a google group ?
I found a google group "Aura" but it is empty. :/
The text was updated successfully, but these errors were encountered: