Skip to content

Custom Autocomplete Editor for Cheetah Grid #447

@olajoke

Description

@olajoke

I am trying to implement an autocomplete editor for a column in Cheetah Grid, but I have encountered significant difficulties. My goal is to provide users with a dropdown of suggestions as they type in a cell, similar to the autocomplete experience in spreadsheet software.

What I’ve Tried

I attempted to extend InlineInputEditor and override onInputCellInternal to add a suggestion dropdown. I also tried implementing the editor interface directly. However, Cheetah Grid expects the action property to be an instance of a class with specific methods (like bindGridEvent), and direct implementation led to errors. I ensured that the column is set as editable and of type text, and that the action is an instance of my custom editor.

Despite these efforts, the custom autocomplete UI does not activate, and the grid does not properly invoke the editor. I suspect there may be internal limitations or undocumented requirements for custom editors.

Questions

  1. Is it possible to extend InlineInputEditor or SmallDialogInputEditor to create a fully custom editor (such as an autocomplete input) that works seamlessly with Cheetah Grid’s editing system? If so, are there any examples or documentation for doing this?
  2. Are there required methods or patterns that must be followed for the editor to be recognised and invoked by the grid?
  3. Would you consider adding a built-in or officially supported autocomplete editor/column to Cheetah Grid?
  4. To contribute, are there any guidelines for implementing a new column type or editor?
  5. Alternatively, is it possible to create a standalone autocomplete column constructor (similar to MenuColumn or CheckColumn) that can be used in the column definition?

Example Use Case:

columns: [
  {
    field: 'category',
    caption: 'Category',
    width: 150,
    columnType: 'autocomplete',
    action: new AutocompleteEditor({
      autocompleteOptions: ['Electronics', 'Clothing', 'Books', 'Food', 'Sports']
    })
  }
]

Thank you for your time and for the excellent work on Cheetah Grid!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions