Context Factory?

  • 4
  • Question
  • Updated 8 months ago
  • Answered
  • (Edited)
Does Skuid have a context factory or something we could use for generating context? ie. from component to component
Photo of Pat Vachon

Pat Vachon, Champion

  • 45,300 Points 20k badge 2x thumb

Posted 2 years ago

  • 4
Photo of Stephen Sells

Stephen Sells, Alum

  • 17,326 Points 10k badge 2x thumb
We have the deck component and page include... I don't think I fully understand what you're asking for. Could you elaborate and possibly give an exact use case? 
Photo of Andréas K.LeF.

Andréas K.LeF.

  • 96 Points 75 badge 2x thumb
Thanks Zach! that was all I needed. It was really much simpler than I thought...
Photo of Andréas K.LeF.

Andréas K.LeF.

  • 96 Points 75 badge 2x thumb
So I ended up with the following code

$a.runActionsNode(actionsNode, component, context ||
          {
              model: model,
              row: rowID ? model.getRowById(rowID) : null,
              initiatorId: initiatorId=event._GUID,
          }
Where the row attribute covers the case where context is row-based and the initiatorId is for component-based context cases
Photo of Andréas K.LeF.

Andréas K.LeF.

  • 96 Points 75 badge 2x thumb
So I ended up with the following code

$a.runActionsNode(actionsNode, component, context ||
          {
              model: model,
              row: rowID ? model.getRowById(rowID) : null,
              initiatorId: initiatorId=event._GUID,
          }
Where the row attribute covers the case where context is row-based and the initiatorId is for component-based context cases
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 3,068 Points 3k badge 2x thumb
@zach could you expand what you offered Pat? :) "If you're trying to do things with "selected Items" or "mass action" type capabilities, that's more complicated, but I could touch on that a bit more."
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 3,068 Points 3k badge 2x thumb
@zach could you expand what you offered Pat? :) "If you're trying to do things with "selected Items" or "mass action" type capabilities, that's more complicated, but I could touch on that a bit more."