Публикация

Добавить колонку на деталь "Файлы"

Вопрос

Необходимо вывести на деталь "Файлы" дату добавления файла

Ответ

Создайте замещающую схему детали:

define("FileDetailV2", ["ViewUtilities", "ConfigurationConstants", "ConfigurationEnums", "ImageListViewModel",
        "css!FileDetailCssModule"], function(ViewUtilities, ConfigurationConstants, ConfigurationEnums) {
    return {
        attributes: {
        },
        messages: {
        },
        methods: {
            getGridDataColumns: function() {
                var baseGridDataColumns = this.callParent(arguments);
                var gridDataColumns = {
                    "Type": {
                        path: "Type"
                    },
                    "Version": {
                        path: "Version"
                    }
                };
                return this.Ext.apply(baseGridDataColumns, gridDataColumns);
            }
        },
        diff: /**SCHEMA_DIFF*/[
            {
                "operation": "remove",
                "name": "DataGrid"
            },
            {
                "operation": "insert",
                "name": "DataGrid1",
                "parentName": "Detail",
                "propertyName": "items",
                "values": {
                    "itemType": Terrasoft.ViewItemType.GRID,
                    "listedZebra": true,
                    "collection": {"bindTo": "Collection"},
                    "activeRow": {"bindTo": "ActiveRow"},
                    "primaryColumnName": "Id",
                    "isEmpty": {"bindTo": "IsGridEmpty"},
                    "isLoading": {"bindTo": "IsGridLoading"},
                    "multiSelect": {"bindTo": "MultiSelect"},
                    "selectedRows": {"bindTo": "SelectedRows"},
                    "sortColumn": {"bindTo": "sortColumn"},
                    "sortColumnDirection": {"bindTo": "GridSortDirection"},
                    "sortColumnIndex": {"bindTo": "SortColumnIndex"},
                    "linkClick": {"bindTo": "linkClicked"},
                    "type": "listed",
                    "visible": {
                        "bindTo": "isImageManagerDetailView",
                        "bindConfig": {"converter": "getDataGridVisible"}
                    },
                    "listedConfig": {
                        "name": "DataGridListedConfig",
                        "items": [
                            {
                                "name": "NameListedGridColumn",
                                "bindTo": "Name",
                                "position": {
                                    "column": 1,
                                    "colSpan": 14
                                },
                                "type": Terrasoft.GridCellType.LINK
                            },
                            {
                                "name": "VersionListedGridColumn",
                                "bindTo": "Version",
                                "position": {
                                    "column": 15,
                                    "colSpan": 3
                                }
                            },
                            {
                                "name": "CreatedOnListedGridColumn",
                                "bindTo": "CreatedOn",
                                "position": {
                                    "column": 22,
                                    "colSpan": 2
                                }
                            }
                        ]
                    },
                    "tiledConfig": {
                        "name": "DataGridTiledConfig",
                        "grid": {
                            "columns": 24,
                            "rows": 3
                        },
                        "items": [
                            {
                                "name": "NameTiledGridColumn",
                                "bindTo": "Name",
                                "position": {
                                    "row": 1,
                                    "column": 1,
                                    "colSpan": 24
                                },
                                "type": Terrasoft.GridCellType.LINK
                            },
                            {
                                "name": "ModifiedByTiledGridColumn",
                                "bindTo": "ModifiedBy",
                                "position": {
                                    "row": 1,
                                    "column": 25,
                                    "colSpan": 12
                                }
                            },
                            {
                                "name": "VersionTiledGridColumn",
                                "bindTo": "Version",
                                "position": {
                                    "row": 1,
                                    "column": 27,
                                    "colSpan": 12
                                }
                            },
                            {
                                "name": "ModifiedOnTiledGridColumn",
                                "bindTo": "ModifiedOn",
                                "position": {
                                    "row": 1,
                                    "column": 39,
                                    "colSpan": 12
                                }
                            },
                            {
                                "name": "SizeTiledGridColumn",
                                "bindTo": "Size",
                                "position": {
                                    "row": 1,
                                    "column": 51,
                                    "colSpan": 12
                                }
                            }
                        ]
                    },
                    "linkClick": {"bindTo": "linkClicked"}
                }
            }
        ]   /**SCHEMA_DIFF*/
    };
});

 

Нравится

Поделиться

0 комментариев
Показать все комментарии