Widget
MMO.elements · 1 symbol · generated 30 Sep 2026
Widget
Widget.js:22Widget WARNING: It is a class mixin. Meaning you extend it with a parameter
- Namespace
MMO.elements- Extends
CustomShadowElement(ClassElement)
Index
| url accessor | Point the widget at a collection; it loads as soon as the element becomes visible. | |
| limit accessor | Number of entities to request per page. | |
| meta readonly accessor | Meta block of the last response ({data: {total, class}, page: {offset, index, total}}), or null when nothing has been loaded yet. | |
| fields accessor | One descriptor per schema property: title, order, hidden, readonly, width, icon... | |
| data accessor | The entities of the last load, indexed by uid. | |
| readonly accessor | ||
| constructor() | ||
| setSchema(schema) | Attach the schema describing the loaded entities, resolving an instanceOf schema to the concrete one, then rebuild the field descriptors. | |
| load(url) | Fetch a collection and publish it as data, rebuilding fields from the response schema. | |
| reload() | Re-fetch the url that was last loaded. | |
| updateFields() | Rebuild fields from the schema's properties, merging into the descriptors already there so a manual override survives a reload. | |
| showAllFields() | Un-hide every field. |
Properties6
url
accessorWidget.js:33Point the widget at a collection; it loads as soon as the element becomes visible.
limit
accessorWidget.js:49Number of entities to request per page.
- Type
number
meta
readonlyaccessorWidget.js:65Meta block of the last response ({data: {total, class}, page: {offset, index, total}}), or null when nothing has been loaded yet.
- Type
?Object
fields
accessorWidget.js:73One descriptor per schema property: title, order, hidden, readonly, width, icon...
- Type
- MMO.core.Map
data
accessorWidget.js:88The entities of the last load, indexed by uid.
- Type
- MMO.core.Map
readonly
accessorWidget.js:210- Type
boolean
Methods6
constructor()
Widget.js:23setSchema(schema)
Widget.js:105Attach the schema describing the loaded entities, resolving an instanceOf schema to the concrete one, then rebuild the field descriptors.
| schema | MMO.schemas.Schema | Object | Promise | |
| returns | Promise<MMO.schemas.Schema> |
load(url)
Widget.js:123Fetch a collection and publish it as data, rebuilding fields from the response schema.
| url | string | the collection's url; pagination is appended unless already present |
| returns | Promise<void> |
reload()
Widget.js:145Re-fetch the url that was last loaded.
| returns | Promise<void> |
updateFields()
Widget.js:158Rebuild fields from the schema's properties, merging into the descriptors already there so a manual override survives a reload. Dispatches schemaChange.
| returns | Promise<MMO.schemas.Schema> |
showAllFields()
Widget.js:201Un-hide every field.