Demo JsonForms / Tree format

Tree format

From Wikisphere
Jump to navigation Jump to search
Bookobject
Title
Book a
Authorsarray(0)
    categories
    • Non-fiction
      • Science
        • Chemistry
        • Mathematics

    This page demonstrates the integration of FancyTree into JsonForms and specifically.

    As for other formats, all the related options are fully configurable via the SchemaBuilder. In addition to the FancyTree original behavior, JsonForms's FancyTree widget allows to save/retrieve data as concatenated titles, while the keys or IDs values can be still used through the option dataOutput. Also, the tree source can be a wiki article in json content content like BookCategories.

    SchemaBuilder tree options

    In the examples below, the first form is used to select categories of a book, and the second form is used to edit the categories data themselves. Note that in a wiki context, the TreeBuilder nodes could be simply replaced with a mw.widgets.TitleInputWidget (via the SchemaBuilder) to select articles, so that the TreeBuilder form can be used to create a tree of wiki articles, and the first form to create a subtree with the selection.


    Schema:

    Tree data:


    Parser function:

    {{#JsonForms: Default
    |schema=Book
    |action = edit
    |edit = {{FULLPAGENAME}}
    |view = inline
    }}
    


    loading form



    {{#JsonForms: Default
    |schema=TreeBuilder
    |action = edit
    |edit = BookCategories
    |slot = main
    |view = inline
    |return_page = {{FULLPAGENAME}}
    }}
    


    loading form


    See also