SmartViewer

The following represents the configuration of a Smart Viewer within the context of a Smart Form. The Smart Viewer also accepts layout JSON configurations, which are explained separately.

{
    "dataSources": {
        "customerDatasource": {
            "objectName": "customerDataSource",
            "entityName": "Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity",
            "tableRef": "eCustomer",
            "entityView": "eSalesrep"
        }
    },
    "columns": [
        {
           "customerToolbar": {
               "componentType": "toolbar",
               "componentOptions": {
                    "objectName": "customerToolbar",
                    "buttons": [
                        "add",
                        "copy",
                        "save",
                        "cancel",
                        "delete"
                    ]
               }
            },
            "customerViewer": {
                "componentType": "viewer",
                "componentOptions": {
                    "viewerLayout": "http://localhost:4200/assets/customer-viewer.structure.json",
                    "objectName": "customerViewer",
                    "dataSource": "customerDataSource",
					"tableIoSource": "customerToolbar"
                }
            }
        }
    ]
}

JSON Properties list and explanations:

PropertyTypeExplanationEquivalent HTML Attribute
viewerLayoutstringReferences the Smart Viewer Layout as retrieved from the backend service.smart-viewer-layout
objectNamestringunique identifier used to obtain references to the Smart Viewer component.smart-object-name
dataSourcestringThe smart-object-name of the Smart Data Source that the viewer should bind to as a value.smart-data-source
tableIoSourcestringAn optional attribute that takes the smart-object-name of a Smart Toolbar as a value. If set, the Smart Viewer will bind to the specified toolbar and respond to add, save, cancel and delete actions of said toolbar.smart-tableio-source

 

See also: Smart Viewer Layouts