I have a custom component that dynamically creates its own model. I'd like to be able to add model actions to that dynamic model through my component's properties in the ui.
Any thoughts on the best way to go about this?
Any thoughts on the best way to go about this?
Matt Sones, Champion
-
31,702 Points
Posted 3 years ago
-
1,244 Points
I made a video for ya:
Hope this helps!
Hope this helps!
(Edited)
-
278 Points
It is not working Please provide me information about custom component
Karen Waldschmitt, Official Rep
-
8,340 Points
Matt Sones, Champion
-
31,702 Points
Thanks, mB Andréas.
That's what I'm intending to do conceptually. I was looking for sample builder (and runtime?) code to make the action framework work with my custom component. Does that exist somewhere?
That's what I'm intending to do conceptually. I was looking for sample builder (and runtime?) code to make the action framework work with my custom component. Does that exist somewhere?
-
1,244 Points
No, not to my knowledge. So far the only two people I've seen accomplish this were Barry and myself, and we've both had to reverse-engineer the skuid CoreComponents to get the code we need to make this work.
I can only suggest you do the same, both the runtime.js and builders.js have good info. You can also look at some of Barry's stuff and see how he's doing it.
We're not necessarily at liberty (yet?) to release the source for making that functionality happen though. This is not an official skuid api, generally undocumented and may be subject to change in the future so YMMV
If you can get a hold of my skype (through Pat perhaps), I'd be glad to point you in the right direction.
I can only suggest you do the same, both the runtime.js and builders.js have good info. You can also look at some of Barry's stuff and see how he's doing it.
We're not necessarily at liberty (yet?) to release the source for making that functionality happen though. This is not an official skuid api, generally undocumented and may be subject to change in the future so YMMV
If you can get a hold of my skype (through Pat perhaps), I'd be glad to point you in the right direction.
Matt Sones, Champion
-
31,702 Points
Thanks. I'll do my best to reverse engineer. Unless skuid wants to share more? Karen?
Ben Hubbard, Employee
-
12,530 Points
Documenting a stable api for building components with all the goodness that we use in our Skuid core components is something we really want to do. I don't have a timeframe on that yet though. In the mean-time Andreas and Barry's approach should work fine. If there are any changes to those undocumented APIs they should be pretty minor.
-
1,280 Points
If you are writing a custom component to install, you can access the Action Framework using skuid.builder.core.getActionsCategory().
That means, in the Builder.js push this property to your properties:
To run all the Actions specified in the Action Framework in the Runtime.js use this code.
Maybe there are way more properties you could set or write cleaner code, but since it's not documented this was all I could find out by analyzing the Skuid Code.
It worked for me when I wrote a custom file upload component.
That means, in the Builder.js push this property to your properties:
skuid.builder.core.getActionsCategory({ label: "My Actions",
customNodeId: "myactions",
linkedComponent: component,
props: [{
type: "helptext",
html: "Here my helptext"
}]
});
To run all the Actions specified in the Action Framework in the Runtime.js use this code.
skuid.actions.runActionsNode(xmlDef.children("myactions"), this.component, {});
Maybe there are way more properties you could set or write cleaner code, but since it's not documented this was all I could find out by analyzing the Skuid Code.
It worked for me when I wrote a custom file upload component.
(Edited)
Shmuel Kamensky, Champion
-
4,472 Points
Is there a way to arbitrarily call action notes without component or context awareness?
For example, when doing model.loadAllRemainingRecords I only want to perform the after query model actions in the finishCallback.
So combining branch logic and snippets, I only have the after model query actions run when loadAllRemainingRecords isn't processing.
Noe I can either implement runActionsNode in the finishCallback [ :-) ] or duplicate the logic inside the snippet and maintain both [ :-( ].
How would I go about calling runActionsNode on a model given its action node (accessible through
For example, when doing model.loadAllRemainingRecords I only want to perform the after query model actions in the finishCallback.
So combining branch logic and snippets, I only have the after model query actions run when loadAllRemainingRecords isn't processing.
Noe I can either implement runActionsNode in the finishCallback [ :-) ] or duplicate the logic inside the snippet and maintain both [ :-( ].
How would I go about calling runActionsNode on a model given its action node (accessible through
skuid.model.getModel('modelname').actions[0].actions )
Related Categories
-
Action Framework
- 23 Conversations
- 35 Followers
-
Javascript Snippets
- 59 Conversations
- 121 Followers