Fullscreen object-table
How to implement
<var name="fullscreen" type="boolean" />
<object-table mode="scroll" id="1" on-state-changed="$:stateChanged($state)">
<column heading="First Name">{first_name}</column>
<column heading="Last Name">{last_name}</column>
<column heading="Age">{age}</column>
<button-group>
<!-- This button is used to toggle full-screen -->
<button label="{$:getButtonLabel()}" on-press="$:toggleFullscreen()" />
</button-group>
</object-table>function getButtonLabel(){
/**
* Here we use the full-screen variable provided from the stateChanged function
* to change the name of the full-screen button
*/
return view.fullscreen ? "Exit fullscreen": "Enter fullscreen";
}
function toggleFullscreen(){
/**
* This will take us in and out of full-screen mode for the <object-table> with ID: '1'
*/
component.objectTable({id: "1"}).toggleFullscreen();
}
function stateChanged(tableState){
/**
* tableState will be provided each time the table goes in and out of fullscreen
*/
view.fullscreen = tableState.fullscreen;
}Tips and tricks
Use fullscreen to provide a richer editing experience
fullscreen to provide a richer editing experienceUse fullscreen to change table modes
Last updated