Skip to content

Commit

Permalink
fix check p.field when it 0
Browse files Browse the repository at this point in the history
explicit check p.field for undefined
  • Loading branch information
d-enk authored and nekufa committed Jan 14, 2023
1 parent 1ff4122 commit 7e9ed21
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions public/admin/js/Space/toolbar/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ Ext.define('Admin.Space.toolbar.Search', {
}, ' ' ];

index.parts.forEach(p => {
var partName = grid.fields[(p.field === undefined && p[0]) || p.field];
if (p.path) {
if (!p.path.startsWith(".")) {
partName += ".";
}
partName += p.path;
}

items.push({
xtype: 'label',
text: grid.fields[p.field || p[0]] + (p.path && '.' + p.path || ''),
text: partName,
});

var field = {
Expand All @@ -41,7 +49,7 @@ Ext.define('Admin.Space.toolbar.Search', {
}

items.push(Ext.apply(field, {
name: grid.fields[p.field || p[0]],
name: partName,
width: 70,
labelAlign: 'right',
enableKeyEvents: true,
Expand Down

0 comments on commit 7e9ed21

Please sign in to comment.