I will do my best to explain as good as I can the problem I have just discovered.
I have a screen with a grid of employees and a dynamic form to edit them. Grid and form use the same REST-ful data source:
The grid has a filter editor and is defined like this:
So the grid shows fields "number", "name" and "company_id". As soon as I enter a filter for "name" and submit the filter, it populates the filter for company_id with the same value. I've found that changing the displayField of the optionDataSource for company_id to another name than "name" does prevent this behaviour, but of course the grid displays only company IDs instead of names.
In the developer console I see the following message and I think it might be related to the error, but I am not sure:
So I've tried to use "defaultFields" (which isn't documented by the way) instead of "fields" in the grid, but this doesn't help. I must also say the form uses the company_id field as well including a getPickListFilterCriteria() method.
Any ideas?
I have a screen with a grid of employees and a dynamic form to edit them. Grid and form use the same REST-ful data source:
Code:
this.employeesDataSource = isc.RestDataSource.create({ ..., fields: [ {name: 'id', hidden: true, primaryKey: true, required: true, type: 'integer'}, {name: 'name', required: true, type: 'text'}, {name: 'number', required: true, type: 'integer'}, {name: 'company_id', displayField: 'name', optionDataSource: app.companiesDataSource, required: true, type: 'integer', valueField: 'id'}, ... ] });
Code:
this.employeesGrid = isc.ListGrid.create({ ..., fields: [ {name: 'number', width: 60}, {name: 'name', width: '*'}, { name: 'company_id', align: 'left', filterEditorProperties: { getPickListFilterCriteria: function () { return { fieldName: 'id', operator: 'inSet', value: [...] }; } }, title: 'Company' } ], showFilterEditor: true });
In the developer console I see the following message and I think it might be related to the error, but I am not sure:
WARN:RecordEditor:isc_ListGrid_184filterEditor:ListGrid initialized with this.fields attribute set to an array containing fields which are already being displayed in another ListGrid instance. To reuse standard field configuration across multiple ListGrids, use listGrid.defaultFields rather than assigning directly to listGrid.fields.
Any ideas?
Comment