Source

tw2.yui / tw2 / yui / samples.py

import widgets as twy, tw2.forms as twf, tw2.core as twc

page_options = {'css_class': 'yui-skin-sam'}

class DemoTabView(twy.TabView):
    tab1 = twf.Label(label='Tab 1', text='This is the first tab')
    tab2 = twf.Label(label='Tab 2', text='And this is the other tab')

class DemoTreeView(twy.TreeView):
    content = [
        {'type':'Text', 'label':'Label 1', 'children':['Sub label %d' % i for i in range(1,11)]},
        {'type':'Text', 'label':'Label 2', 'children':['Sub label %d' % i for i in range(1,11)]},
        {'type':'Text', 'label':'Label 3', 'children':['Sub label %d' % i for i in range(1,11)]},
    ]

class DemoEditor(twy.Editor):
    rows = 5

class DemoAutoComplete(twy.AutoComplete):
    class datasrc(twy.LocalDataSource):
        resources = twy.DataSource.resources + [
            twc.JSLink(modname=__name__, filename="static/sample-data.js"),
        ]
        data = 'YAHOO.example.Data.arrayStates'
        responseSchema = {'fields': ["state"]};


class DemoDataTable(twy.DataTable):
    id = twy.Column()
    name = twy.Column()
    class datasrc(twy.LocalDataSource):
        resources = twy.DataSource.resources + [
            twc.JSLink(modname=__name__, filename="static/sample-data.js"),
        ]
        data = 'YAHOO.example.Data.accounts'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.