mmo-table
1 symbole · générée le 27 Oct 2026
mmo-table
mmo-table.jhs:1Table class
- Étend
- CustomAPIElement
Index
| url | an url to a json api or a json stringify object: {collection, repository, filters} | |
| readonly | if true, the table is readonly | |
| empty | what the table says when it has no row ("No result", translated, by default) | |
| widths | the width this page gives some columns, over their schema's: json, {path: css width} ({"entreprises": "18em"}); a column resized by hand keeps its own, and a reset goes back to this one | |
| ViewDefault static readonly accessor | ||
| readonly accessor | Get the readonly of the table | |
| url accessor | Get the url of the table | |
| data accessor | Get the data of the table | |
| fields accessor | Get the fields of the table | |
| widthsKey readonly accessor | The key this table's column widths are remembered under: the id the page gave it, or the path of the collection it reads -- never the query, so a filter or another page keeps the same widths. | |
| pageWidths readonly accessor | The widths the page gives some columns (the widths attribute), by field path: the default of these columns on this page only, where the schema's width is the default of the property everywhere. | |
| constructor() | ||
| init() | ||
| toggleConfig() | Toggle the configuration of the table | |
| setAPI(api) | Set the API of the table | |
| updateSearch() | Rebuild the query bar, after the schema or the fields it offers have changed. | |
| initColumnResize(view) | Give a column's grip its drag gesture. | |
| resetColumnWidth(grip) | Put a column back to the width its schema asked for, and forget what it was dragged to. | |
| resizeColumnByKey(event, grip) | Resize the focused column from the keyboard: left and right by 16px, 4px with shift, Home back to the schema's width. | |
| setColumnWidth(th, width) | Write a column's width where the header reads it from -- the field model, which the width binding renders -- and remember it for the next visit. | |
| indexOfField(path) | The index of a field, from the data-key its header carries. | |
| getStoredWidths() | The widths this table was left with, by field path. | |
| storeColumnWidth(path, width) | Remember what a column was resized to, or forget it. | |
| deleteField(view) | Delete a field from the table | |
| setApiSort(value) | Set the sort of the table | |
| setApiFields(value) | Set the fields of the table | |
| updateFieldsSort() | Update the sort of the table | |
| updateFields(view) | Update the fields of the table | |
| reload() | Reload the table | |
| sortByColumn(event, th) | Order the rows by a column, from a click on its header: a second click turns the order around, another column starts ascending. | |
| openRowFromClick(event, tr) | Open a row's entity from a click anywhere on the row, as its pencil does: in this tab, or in a new one with ctrl (cmd on a mac). | |
| getRowIndex(tr) | Get the index of the row | |
| getRowTitle(tr) | Return the text content of the first real column (the 3rd) (first is the line number, second id the checkbox) | |
| gotoTop() | Go to the top of the table | |
| gotoBottom() | Go to the bottom of the table | |
| print() | Print the table | |
| export(ext) | Export the table | |
| bookmark() | Bookmark the table | |
| selectAll(selected) | Select all the rows of the table | |
| getSelectedIndex() | Get the indexes of the selected rows | |
| selectRow(input) | Select a row of the table | |
| focus() | Focus the table This function is not called at all in the code at the moment, but it is here for future reference. | |
| unfocus() | Unfocus the table This function is not called at all in the code at the moment, but it is here for future reference. | |
| setCurrent(td) | Set the current cell of the table | |
| updateRow(tr) | Update a row of the table | |
| editRow(button, target) | Edit a row of the table | |
| deleteRow(button, permanent) | Delete a row of the table | |
| deleteRowByIndex(index, permanent) | Delete a row of the table by index | |
| deleteRows(indexes) | Delete multiple rows of the table | |
| restoreRow(button) | Restore a row of the table | |
| insertRow() | Insert a row of the table | |
| nextCell(editable) | Go to the next cell of the table | |
| prevCell(editable) | Go to the previous cell of the table | |
| nextRow() | Go to the next row of the table | |
| prevRow() | Go to the previous row of the table | |
| onKeyDown(event) | Allows to navigate through the table using the keyboard | |
| updateLinesSelected() | Update the lines selected | |
| displayIDs() | Display the IDs of the selected rows | |
| changeStatus(value) | Change the status of the selected rows | |
| header | anything above the table, next to the query bar | |
| search | the control the query bar searches with, when the page provides its own | |
| toolbar | the buttons of the dropdown a column header opens | |
| .with-config | add a configuration button to the table | |
| .fullscreen | update the height of the table to 85vh | |
| .no-actions | hide the actions column | |
| .no-query | hide the query | |
| .with-toolbar | rows are selected: the selection toolbar shows under the table | |
| .no-row-click | a click on a row does not open it (only its pencil button does) | |
| .full-names | an entity's name in a cell is never cut after two lines: it wraps on as many as it needs |
Attributs4
url
mmo-table.jhsan url to a json api or a json stringify object: {collection, repository, filters}
url
readonly
mmo-table.jhsif true, the table is readonly
readonly
empty
mmo-table.jhswhat the table says when it has no row ("No result", translated, by default)
empty
widths
mmo-table.jhsthe width this page gives some columns, over their schema's: json, {path: css width} ({"entreprises": "18em"}); a column resized by hand keeps its own, and a reset goes back to this one
widths
Propriétés7
ViewDefault
staticreadonlyaccessormmo-table.jhs:131readonly
accessormmo-table.jhs:193Get the readonly of the table
- Type
boolean
url
accessormmo-table.jhs:210Get the url of the table
- Type
string
data
accessormmo-table.jhs:226Get the data of the table
- Type
array
fields
accessormmo-table.jhs:262Get the fields of the table
- Type
array
widthsKey
readonlyaccessormmo-table.jhs:382The key this table's column widths are remembered under: the id the page gave it, or the path of the collection it reads -- never the query, so a filter or another page keeps the same widths.
- Type
?string
pageWidths
readonlyaccessormmo-table.jhs:398The widths the page gives some columns (the widths attribute), by field path: the default of these columns on this page only, where the schema's width is the default of the property everywhere.
- Type
object
Méthodes48
constructor()
mmo-table.jhs:122init()
mmo-table.jhs:135toggleConfig()
mmo-table.jhs:180Toggle the configuration of the table
setAPI(api)
mmo-table.jhs:243Set the API of the table
| api | object | - The API of the table |
updateSearch()
mmo-table.jhs:254Rebuild the query bar, after the schema or the fields it offers have changed.
| retourne | void |
initColumnResize(view)
mmo-table.jhs:287Give a column's grip its drag gesture. Called by the header loop for every column it inserts.
| view | object | - the view of the field, one per header cell |
| retourne | void |
resetColumnWidth(grip)
mmo-table.jhs:318Put a column back to the width its schema asked for, and forget what it was dragged to.
| grip | HTMLElement | - the grip of the column |
| retourne | void |
resizeColumnByKey(event, grip)
mmo-table.jhs:329Resize the focused column from the keyboard: left and right by 16px, 4px with shift, Home back to the schema's width. Without this a column can only be resized with a pointer.
| event | KeyboardEvent | |
| grip | HTMLElement | - the grip of the column |
| retourne | void |
setColumnWidth(th, width)
mmo-table.jhs:351Write a column's width where the header reads it from -- the field model, which the width binding renders -- and remember it for the next visit.
| th | HTMLElement | - the header cell |
| width | ?string | - a css width, or null to go back to what the schema asked for |
| retourne | void |
indexOfField(path)
mmo-table.jhs:369The index of a field, from the data-key its header carries.
| path | string | - the field's path |
| retourne | ?string | null when no field has that path |
getStoredWidths()
mmo-table.jhs:416The widths this table was left with, by field path.
| retourne | object | empty when nothing was ever stored |
storeColumnWidth(path, width)
mmo-table.jhs:430Remember what a column was resized to, or forget it.
| path | string | - the field's path |
| width | ?string | - a css width, or null to drop it |
| retourne | void |
deleteField(view)
mmo-table.jhs:451Delete a field from the table
| view | object | - The view of the field |
setApiSort(value)
mmo-table.jhs:463Set the sort of the table
| value | string | - The sort of the table |
setApiFields(value)
mmo-table.jhs:473Set the fields of the table
| value | string | - The fields of the table |
updateFieldsSort()
mmo-table.jhs:484Update the sort of the table
updateFields(view)
mmo-table.jhs:507Update the fields of the table
| view | object | - The view of the field |
reload()
mmo-table.jhs:567Reload the table
sortByColumn(event, th)
mmo-table.jhs:656Order the rows by a column, from a click on its header: a second click turns the order around, another column starts ascending. The page hears of it through the reload event, as for any other search.
| event | MouseEvent | |
| th | HTMLElement | - the header of the column |
| retourne | void |
openRowFromClick(event, tr)
mmo-table.jhs:674Open a row's entity from a click anywhere on the row, as its pencil does: in this tab, or in a new one with ctrl (cmd on a mac). What the row holds keeps its own click.
| event | MouseEvent | |
| tr | HTMLElement | - the row |
| retourne | void |
getRowIndex(tr)
mmo-table.jhs:689Get the index of the row
| tr | Element | - The row of the table |
| retourne | number | The index of the row |
getRowTitle(tr)
mmo-table.jhs:703Return the text content of the first real column (the 3rd) (first is the line number, second id the checkbox)
| tr | Element | - The row of the table |
| retourne | string | The text content of the first real column |
gotoTop()
mmo-table.jhs:710Go to the top of the table
gotoBottom()
mmo-table.jhs:718Go to the bottom of the table
print()
mmo-table.jhs:730Print the table
export(ext)
mmo-table.jhs:761Export the table
| ext | string | - The extension of the export |
bookmark()
mmo-table.jhs:774Bookmark the table
selectAll(selected)
mmo-table.jhs:786Select all the rows of the table
| selected | boolean | - Whether to select all the rows |
getSelectedIndex()
mmo-table.jhs:807Get the indexes of the selected rows
| retourne | array | The indexes of the selected rows |
selectRow(input)
mmo-table.jhs:817Select a row of the table
| input | Element | - The input of the row |
focus()
mmo-table.jhs:836Focus the table This function is not called at all in the code at the moment, but it is here for future reference.
unfocus()
mmo-table.jhs:850Unfocus the table This function is not called at all in the code at the moment, but it is here for future reference.
setCurrent(td)
mmo-table.jhs:861Set the current cell of the table
| td | Element | - The cell of the table |
updateRow(tr)
mmo-table.jhs:888Update a row of the table
| tr | Element | - The row of the table |
editRow(button, target)
mmo-table.jhs:915Edit a row of the table
| button | Element | - The button of the row, or the row itself |
| target = '_blank' | string | - where an entity edited in its own page opens it (MMO.elements.Entity.edit) |
deleteRow(button, permanent)
mmo-table.jhs:931Delete a row of the table
| button | Element | - The button of the row |
| permanent = false | boolean | - Whether to permanently delete the row |
deleteRowByIndex(index, permanent)
mmo-table.jhs:952Delete a row of the table by index
| index | number | - The index of the row |
| permanent = false | boolean | - Whether to permanently delete the row |
| retourne | Promise<void> | once the server has answered and the row shows it |
deleteRows(indexes)
mmo-table.jhs:965Delete multiple rows of the table
| indexes | array | - The indexes of the rows |
restoreRow(button)
mmo-table.jhs:1004Restore a row of the table
| button | Element | - The button of the row |
insertRow()
mmo-table.jhs:1017Insert a row of the table
nextCell(editable)
mmo-table.jhs:1109Go to the next cell of the table
| editable = null | boolean | - Whether the cell is editable |
prevCell(editable)
mmo-table.jhs:1131Go to the previous cell of the table
| editable = null | boolean | - Whether the cell is editable |
nextRow()
mmo-table.jhs:1157Go to the next row of the table
prevRow()
mmo-table.jhs:1176Go to the previous row of the table
onKeyDown(event)
mmo-table.jhs:1196Allows to navigate through the table using the keyboard
| event | Event | - The event |
updateLinesSelected()
mmo-table.jhs:1265Update the lines selected
displayIDs()
mmo-table.jhs:1282Display the IDs of the selected rows
changeStatus(value)
mmo-table.jhs:1309Change the status of the selected rows
| value | string | - The status to change to |
Slots3
header
mmo-table.jhsanything above the table, next to the query bar
<slot name="header">
search
mmo-table.jhsthe control the query bar searches with, when the page provides its own
<slot name="search">
toolbar
mmo-table.jhsthe buttons of the dropdown a column header opens
<slot name="toolbar">
Points d'accroche CSS7
.with-config
mmo-table.jhsadd a configuration button to the table
.with-config
.fullscreen
mmo-table.jhsupdate the height of the table to 85vh
.fullscreen
.no-actions
mmo-table.jhshide the actions column
.no-actions
.no-query
mmo-table.jhshide the query
.no-query
.with-toolbar
mmo-table.jhsrows are selected: the selection toolbar shows under the table
.with-toolbar
.no-row-click
mmo-table.jhsa click on a row does not open it (only its pencil button does)
.no-row-click
.full-names
mmo-table.jhsan entity's name in a cell is never cut after two lines: it wraps on as many as it needs
.full-names