Skip to content

Xtype field ​

Embeds a ready ExtJS component into the form — one already registered in the manager, whether by PageBlocks or by another extra.

What it reads: component — the registered xtype to draw — and optionally bind, the parameter the component should receive the current record's id in.

Those two have no inputs in the field editor

The field window shows nothing for this type, so the values have to be written straight into the field's properties, which in practice means a satellite component or a migration:

json
{"component": "pbs-grid-orderitems", "bind": "order_id"}

A field created by hand in the manager therefore always falls back to the hint below.

This is not "any input type": the component has to be registered. It is how a grid from a satellite component ends up on a block's form — an order's items, a subscription's payments.

It degrades to a hint instead of breaking

If the component is not registered, or the record has no id yet while the field needs one, the form shows the field's help text in place of the component. So a field on a not-yet-saved record explains itself instead of failing.

That fallback is worth writing for: fill in the help text with what the editor should do — usually "save the record first".

© PageBlocks 2019-present