I have an autocomplete bound to a tree grids edit mode for the column.
I have a value selected for the autocomplete.
When the user hits the down arrow to see the drop down options I would like them to see all the options vs the filter down to the selected text.
I thought I could do this via the filter event but it does not seem to fire when the user hits the drop down.
Why is the best way to show all drop down options for this scenario without the filter?
|
App.component.html
<ejs-treegrid #treegrid [dataSource]='data' height='350' childMapping='subtasks' [treeColumnIndex]='1' [editSettings]='editSettings' [toolbar]='toolbar'>
<e-columns>
<e-column field='taskID' headerText='Task ID' width='70' isPrimaryKey='true' ></e-column>
<e-column field='taskName' headerText='Task Name' width='200' [validationRules]='tasknamerules' [edit]='dpParams' ></e-column>
…
</ejs-treegrid>
App.component.ts:
………
};
this.toolbar = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'];
this.validationRules = { minLength: 0 };
this.edit = { params: { format: 'n' } };
this.numericParams = { params: { format: 'n' } };
this.taskidrules = { required: true, number: true };
this.tasknamerules = { required: true };
this.startdaterules = { date: true };
this.durationrules = { number: true, min: 0 };
this.progressrules = { number: true, min: 0 };
this.dpParams = {
create: () => {
let elem: HTMLInputElement = document.createElement('input');
elem.id = 'taskname';
return elem;
},
read: () => {
return this.dropdownObj.value;
},
destroy: () => {
this.dropdownObj.destroy();
},
write: (args: {
rowData: Object;
column: Column;
element: HTMLElement;
}) => {
this.dropdownObj = new DropDownList({
dataSource: <{ key: string; value: any }[]>(
this.treegrid.grid.dataSource
),
fields: { value: 'taskName' },
value: args.rowData[args.column.field],
});
this.dropdownObj.appendTo(args.element);
},
};
}
}
|
I actually need the autocomplete feature that allows typing, so the normal dropdown will not work for this situation.
When the user edits a row, they are going to either type in the new value or use the dropdown. With the autocomplete hitting the dropdown has an undesirable behavior of showing just the value they are trying to switch from.
I've been able to change this behavior with the filtering event, but the filtering event does not fire when the user hits the dropdown to change the content of the pop up.
That's what I'm looking for here. If the user has an item selected to show all the options when they hit the dropdown instead.
|
App.component.ts
write: (args: {
rowData: Object;
column: Column;
element: HTMLElement;
}) => {
this.autoCompleteObj = new AutoComplete({
dataSource: <{ key: string; value: any }[]>(
this.treegrid.grid.dataSource
),
fields: { value: 'taskName' },
value: args.rowData[args.column.field],
filtering: (e) => {
alert('This is filtering event');
},
});
this.autoCompleteObj.appendTo(args.element);
},
|
In the filter event you can change what's in the dropdown.
I would like to do something similar when the user opens the dropdown, however, the filter event does not fire when the user hits the dropdown.
Is there an event where I can update what will be in the dropdown when the user opens it so that I can show all items instead of what matches the text selected in the autocomplete.
|
App.component.ts
write: (args: {
rowData: Object;
column: Column;
element: HTMLElement;
}) => {
this.autoCompleteObj = new AutoComplete({
dataSource: <{ key: string; value: any }[]>(
this.treegrid.grid.dataSource
),
fields: { value: 'taskName' },
value: args.rowData[args.column.field],
focus: (args) => {
this.autoCompleteObj.showPopup();
},
filtering: (e) => {
alert('This is filtering event');
},
});
this.autoCompleteObj.appendTo(args.element);
},
|
This was the default behavior of the ComboBox, which seems to have all of the same functionality of the AutoComplete. When I switched over it worked by default.