Row Context for page include url parameters?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have a table. I want to open the record detail from a row action. I have the record detail set up in a separate page, so I am using a page include. I have tried a page include to the record detail page in a drawer and a popup. The problem is that the url parameters that I pass into my page include don't have a row context. It is always displaying row 0 in the page include regardless of which row in the table I click. Is there a way to pass in row context into the url parameters of a page include?
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
There probably is another way, but if you had to you could do it with javascript. See Moshe's comment here: https://community.skuidify.com/skuid/topics/update-page-include-from-table-row-action
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Thanks Matt!
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
This can be done with javascript


//you can access any data from your row you need using params.row.fieldName
var oppId = params.row.Id;
panelsOnPage = skuid.component.getByType('includepanel');
//goes through all includepanels and returns the one in your context 
//(additional filtering needs to be done if you have 
//multiple pageincludes per context)
panelInContext = panelsOnPage.filter(
    
    function(panel) {
    
        return panel.context.row.Id == oppId;
    })[0];

//set the query string and load the file
//like Moshe's code in Matt's comment
panelInContext.querystring='oppId='+oppId;
panelInContext.load();
panelInContext.querystring='oppId='+oppId;
panelInContext.load();

But I couldn't use this since I couldn't get models with conflicting names to save. Once you add an additional pageInclude onto the parent page, all models from previous pageIncludes with the same page source are dropped. See the idea to vote on it here.
https://community.skuid.com/skuid/topics/include-a-page-multiple-times-on-a-page-dynamic-model-names
(Edited)