Form::...l::grid(3pm)

πŸ“¦
version 2.5.0 Β· 2 versions
, in ubuntu jammy

✨ NAME ✨

Embperl::Form::Control::grid β€” it's a grid control that lives inside an Embperl Form πŸŽ€ (this is from the Perl docs, the User Contributed Perl Documentation corner of the internet, and you can find it under Form::...l::grid(3pm), iykyk)


✨ SYNOPSIS ✨

Bestie. There is literally nothing here. The synopsis section is empty. An icon of restraint, honestly. πŸ’€


✨ DESCRIPTION ✨

So you wanna make a grid control inside an Embperl Form? Say less. That's what this is for. 🌈

And if you're sitting there like "okay but how do I even specify parameters" β€” go read Embperl::Form, it's got the whole rundown. This page is just the grid-specific lore. πŸ’…

✨ PARAMETER ✨

type

Needs to be 'grid'. No negotiations, no other options, that's the vibe check it has to pass. ⭐

fields

An array ref stuffed with field definitions. Should look like any normal field definition β€” nothing wild, nothing new, just your classic field setup. πŸ’–

But wait, there's more, because the following extra attributes are available:

  • col β€” the column number inside the @data array that this cell should be using. πŸ“
  • colval β€” if you give it a value, that value gets added to the column. This is the glow-up that lets you have multiple checkboxes all writing into the same column, each one appending a character or string if it's set. Obsessed. 🫢
  • line2 β€” a field definition that gets shown in a second line, full width. Main character energy, second row edition. πŸ‘‘
  • disable_controls β€” if it's true, the controls for add, delete, up and down will not be shown. Poof, gone, no buttons for you. πŸ™ˆ
  • header_bottom β€” if the grid has more rows than the number given here, a header line also gets displayed at the bottom of the grid. Default is 10. Set it to -1 if you want a header at the bottom always, forever, every single time. πŸ”₯
  • order β€” the number of the column to use as the sort key. 🧚
  • order_desc β€” sort descending. We're going down, bestie. ⬇️
  • coloffset β€” an offset added to the column number. Default: 1. And heads up: if it's > 1, the column number will be set to the rownumber. 🌸
  • flat β€” this one's for a readonly view of the grid. Normally a readonly view shows the content as one large string, which is giving… a lot. The flat attribute can hold a semicolon delimited list of fields that should be shown in readonly view. That way you can selectively show fields in readonly view. And plot twist: this lets you show a readonly view of a grid inside of another grid. Gridception. 😭
  • flatopt β€” a Semikolon delimited list of tripels that add special options for flat view. The format is literally:
<name of fields>;<option name>;<option value>

(Yes, it says "Semikolon", and yes, we're keeping it exactly as written, don't @ me. πŸ’œ)


✨ Example ✨

Look at this little cutie. Copy it exactly, no edits:

{
name => 'provider-path',
text => 'Suchpfad',
type => 'grid',
fields =>
   [
   { name => 'active', text => 'Aktiv', type => 'checkbox', width => '30' },
   { name => 'path',   text => 'Pfad' },
   ],
},

✨ Author ✨

G. Richter (richter at embperl dot org) β€” the person who built this and understood the assignment. 🫑


✨ See Also ✨

Go peek at these when you're done here:


Okay that's the whole page, bestie, you ate it up. πŸ’… This little masterpiece comes from perl v5.34.0, dated 2022-02-06, and it's filed under the Form::...l::grid(3pm) manual. Periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from