Skip to content

Commit

Permalink
Handle mime-type as system column. (#803)
Browse files Browse the repository at this point in the history
* Handle mime-type as system column.

* width
  • Loading branch information
cancan101 authored Dec 20, 2024
1 parent 58643e5 commit bf8a2a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/js/pimcore/asset/helpers/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ pimcore.asset.helpers.grid = Class.create({
text: t(field.label), width: this.getColumnWidth(field, 130), locked: this.getColumnLock(field), sortable: true,
dataIndex: field.key, filter: {type: 'list', options: ['image', 'text', 'audio', 'video', 'document', 'archive', 'unknown']}
});
} else if (key == "mimetype") {
gridColumns.push({
text: t(field.label), sortable: true, dataIndex: field.key, editable: false,
width: this.getColumnWidth(field, 210), locked: this.getColumnLock(field), filter: 'string', renderer: Ext.util.Format.htmlEncode
});
} else {
gridColumns.push({
text: t(field.label), width: this.getColumnWidth(field, 130), locked: this.getColumnLock(field), sortable: true,
Expand Down
1 change: 1 addition & 0 deletions src/Service/GridData/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static function getData(Model\Asset $asset, array $fields = null, string
'id' => $asset->getId(),
'id~system' => $asset->getId(),
'type~system' => $asset->getType(),
'mimetype~system' => $asset->getMimeType(),
'fullpath~system' => $asset->getRealFullPath(),
'filename~system' => $asset->getKey(),
'creationDate~system' => $asset->getCreationDate(),
Expand Down

0 comments on commit bf8a2a1

Please sign in to comment.