Arguments for Page Title button - row is undefined

  • 1
  • Problem
  • Updated 4 years ago
  • Acknowledged
Having a problem with the arguments passed to my snippet from a Page Title component.

var model = arguments[0].model, 
row = arguments[0].row;


I'm getting model, but row comes back undefined, even though there is a row of data in the model (model.data[0] exists). Any idea why this might be happening?

Is model.data[0] equivalent to a row object? In that case, I could just use

var model = arguments[0].model,
 row = model.data[0];
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Update: using row = model.data[0] works, so this is now less of a problem and more of a matter for curiosity.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I believe that row = arguments[0].row is only available when the snippet has a row in context. ie. a row action, model action "Row in Model updated", etc
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
That's that I would have expected, too, Pat. But I've been successfully using arguments[0].row on page title components. Suddenly, when I throw a copy of the pagetitle into a popup, row is undefined (with or without context conditions on the pagetitle component). Seems strange.

Maybe the bug is that it shouldn't work in general. ;)
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
I'm assuming that arguments[0].row is only undefined when the Page Title is in a Popup? Is that true?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
That seems to be the case.