close

Filter

loading table of contents...

Studio Developer Manual / Version 2310

Table Of Contents

9.15.2 Defining Additional Data Fields for List Views

If you need additional fields in the underlying store, you can add fields using the listViewDataFields property of the ConfigureListViewPlugin. The standard columns do not need an explicit field configuration. But if, for example, you want to display the name of the user who created a content, the implementation would look like this:

import Config from "@jangaroo/runtime/Config";
import GridColumn from "@jangaroo/ext-ts/grid/column/Column";
import DataField from "@coremedia/studio-client.ext.ui-components/store/DataField";
import ConfigureListViewPlugin from "@coremedia/studio-client.main.editor-components/sdk/plugins/ConfigureListViewPlugin";

//...
Config(ConfigureListViewPlugin, {
  instanceName: "myListConfiguration",
  listViewDataFields: [
    Config(DataField, {
      name: "creator",
      mapping: "creator.name",
    }),
  ],

  repositoryListViewColumns: [
    Config(GridColumn, {
      width: 75,
      dataIndex: "creator",
      header: "Creator",
    }),
  ],
})

Example 9.43. Defining list view fields


In this case, an Ext JS gridcolumn is used for display, setting the column's attributes as needed. The definition of the field is slightly complex, because the property name of the property creator of each content in the search result should be accessed. To this end, a non-trivial mapping property will be added, but the name attribute of the data field and the dataIndex attribute of the column will be kept simple and in sync. If the mapping property were identical to the name property of the field, it could have been omitted.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.