Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Here is a sample Smart Grid JSON configuration:

Code Block
languagejs
{
    "dataSources": {
        "customerDatasource": {
            "objectName": "customerDataSource",
            "entityName": "Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity",
            "tableRef": "eCustomer",
            "entityView": "eSalesrep"
        }
    },
    "settings": {
        "classList": [
            "customer-form"
        ],
        "style": {
            "font-size": "15"
        }
    },
    "columns": [
        {
            "customerGrid": {
                "componentType": "grid",
                "componentOptions": {
                    "gridLayout": {
                        "height": 500,
                        "width": 600,
                        "scrollable": "scrollable",
                        "sortable": true,
                        "selectable": "row",
                        "pageable": {
                            "pageSizes": [
                                10,
                                25,
                                100
                            ],
                            "buttonCount": 5
                        },
						"resizable": true,
                        "columns": [
                            {
                                "field": "CustNum",
                                "title": "Cust Num",
                                "width": "100"
                            },
                            {
                                "field": "Name",
                                "title": "Name",
                                "width": "240"
                            },
                            {
                                "field": "Country",
                                "title": "Country",
                                "width": "160",
                                "windowSizes": [
                                    "lg",
                                    "md"
                                ]
                            },
                            {
                                "field": "City",
                                "title": "City",
                                "width": "200",
                                "windowSizes": [
                                    "lg"
                                ]
                            },
                            {
                                "field": "eSalesrep[0].RepName",
                                "title": "Rep Name",
                                "width": "240",
                                "template": "childRelation:eSalesrep:RepName",
                                "windowSizes": [
                                    "lg"
                                ]
                            },
                            {
                                "type": "command",
                                "width": "50",
                                "form": "\/customer\/:CustNum\/orders",
                                "text": "View Orders",
                                "imageUrl": "Consultingwerk\/SmartComponentsDemo\/Web2\/Images\/package.png"
                            },
                            {
                                "type": "command",
                                "width": "50",
                                "action": "PutCustomerOnHoldHandler",
                                "text": "Put customer on credit hold",
                                "imageUrl": "Consultingwerk\/SmartComponentsDemo\/Web2\/Images\/sign_stop.png"
                            }
                        ],
                        "detailTemplate": {
                            "dataSources": [
                                {
                                    "objectName": "orderDataSource",
                                    "entityName": "Consultingwerk.SmartComponentsDemo.OERA.Sports2000.OrderBusinessEntity",
                                    "tableRef": "eOrder",
                                    "entityView": "eCustomer",
                                    "initialFilter": {
                                        "operator": "eq",
                                        "field": "CustNum",
                                        "value": "[dataItem.CustNum]"
                                    }
                                }
                            ],
                            "rows": [
                                {
                                    "orderGrid": {
                                        "componentType": "grid",
                                        "componentOptions": {
                                            "gridLayout": "Consultingwerk.SmartComponentsDemo.OERA.Sports2000.OrderBusinessEntity/order",
                                            "dataSource": "orderDataSource",
                                            "objectName": "orderGrid"
                                        }
                                    }
                                }
                            ]
                        }
                    },
					"disableTextSelection": true,
                    "dataSource": "customerDataSource",
                    "objectName": "customerGrid"
                }
            }
        }
    ]
}


 

...

PropertyTypeExplanationEquivalent HTML Attribute
gridLayoutstring | object

The reference to the grid layout to be retrieved from the backend service, or the actual grid layout object.

smart-grid-layout
objectNamestringunique identifier used for obtaining references to the grid componentsmart-object-name
dataSourcestringThe smart-object-name of the Smart Data Source that the grid should bind tosmart-data-source
filterablelogicalUse this to disable filtering support. By default, filtering is enabled. Filtering can also be disabled using the grid layout.filterable
gridLayout.resizablelogicalAllows resizing of the SmartGrid's columns.
disableTextSelectionlogicalDisables the text selection in the grid's rows.disable-text-selection