How to use the tabris.contentView.append function in tabris

To help you get started, we’ve selected a few tabris examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipsesource / tabris-js / snippets / stack-alignment.jsx View on Github external
import {contentView, TextView, Stack} from 'tabris';

contentView.append(
  
    lorem
    ipsum dolor
    sit amet
    consectetur
  
).find(TextView).set({font: '48px', textColor: 'white'});
github eclipsesource / tabris-js / snippets / device.jsx View on Github external
import {contentView, device, TextView} from 'tabris';

contentView.append();

device.onOrientationChanged(renderDeviceProperties);
renderDeviceProperties();

function renderDeviceProperties() {
  $(TextView).only().text =
    <$>
      <b>Platform:</b> {device.platform}<br>
      <b>Version:</b> {device.version}<br>
      <b>Model:</b> {device.model}<br>
      <b>Vendor:</b> {device.vendor}<br>
      <b>Name:</b> {device.name}<br>
      <b>Language:</b> {device.language}<br>
      <b>Orientation:</b> {device.orientation}<br>
      <b>Screen:</b> {device.screenWidth} x {device.screenHeight}<br>
      <b>Scale:</b> {device.scaleFactor}<br>
github eclipsesource / tabris-js / snippets / alertdialog.jsx View on Github external
import {AlertDialog, Button, Stack, TextInput, TextView, contentView} from 'tabris';

contentView.append(
  
    <button>Simple dialog</button>
    <button>Dialog with multiple buttons</button>
    <button>Self-closing dialog</button>
    <button>Dialog with text fields</button>
    
  
);

const textView =  $().only(TextView);

async function showSimpleDialog() {
  await AlertDialog.open('Comment saved').onClose.promise();
  textView.text = 'Dialog closed';
}
github eclipsesource / tabris-js / snippets / collectionview-cellheightauto.jsx View on Github external
import {TextView, CollectionView, contentView} from 'tabris';

const items = createItems();

contentView.append(
   new TextView({padding: 12})}
      updateCell={(cell, index) =&gt; cell.text = items[index]}/&gt;
);

function createItems() {
  const text = (
    &lt;$&gt;
      Sed ut perspiciatis unde omnis iste natus error sit voluptatem
      accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab
      illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
      Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
      sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
      Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,
      adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et
github eclipsesource / tabris-js / snippets / local-storage.jsx View on Github external
import {Button, TextView, TextInput, contentView, Stack} from 'tabris';

contentView.append(
  
    
    
    <button>
    </button><button>
    </button><button>
    </button><button>
    </button><button>
    
  
);

const keyField = $('#key').only(TextInput);
const valueField = $('#value').only(TextInput);
const output = $('#output').only(TextView);
</button>
github eclipsesource / tabris-js / snippets / textview-markupenabled.jsx View on Github external
import {CheckBox, contentView, Stack, TextView} from 'tabris';

contentView.append(
  
    
      Normal Text <b>bold</b> <i>italic</i><br>
      <big>big</big><br>
      <small>small</small><br>
      <strong>strong</strong><br>
      <ins>inserted</ins><br>
      <del>deleted</del>
    
     $(TextView).only().markupEnabled = e.checked}/&gt;
  
);
github eclipsesource / tabris-js / snippets / layout-stack.jsx View on Github external
import {contentView, TextView, StackLayout, ScrollView} from 'tabris';

contentView.append(
  
    lorem
    ipsum dolor
    sit amet
  
).find(TextView).set({font: '48px', textColor: 'white'});
github eclipsesource / tabris-js / snippets / imageview-zoom.jsx View on Github external
import {CheckBox, Composite, contentView, ImageView, Slider, Stack, TextView} from 'tabris';

contentView.append(
  
     zoomLevelSlider.selection = ev.zoomLevel * 10}/&gt;
    
       setZoomEnabled(ev.value)}/&gt;
       setZoomLevel(ev.value / 10)}/&gt;
       setMinZoomLevel(ev.value / 10)}/&gt;
       setMaxZoomLevel(ev.value / 10)}/&gt;
    
  
);
github eclipsesource / tabris-js / snippets / layout-center.jsx View on Github external
import {Composite, contentView} from 'tabris';

contentView.append(
  &lt;$&gt;
    
    
    
    
    
  
);
github eclipsesource / tabris-js / snippets / button.jsx View on Github external
import {Button, contentView} from 'tabris';

let count = 0;

contentView.append(
  <button>Button</button>
);

function countUp() {
  $(Button).set({text: `Pressed ${++count} times`});
}