4

I made a fiddle with this example. Example with fiddle.

In the 4th colum there are some cells that I want to disable the write mode and activate the dropdown. Actually I have the dropdown and works well for me but I can keep writing in it and I want to disable this option.

I just want only let the people choose one of these options. In this example the color or Bumber.

I tried this including ReadOnly:

    {
      data: 'bumper',          
      type: 'dropdown',
      readOnly: true, 
      source: ['Red', 'Blue', 'Green']
    }

But (obviously) disable the whole cell and don't allow edit the cell with the dropdown.

Arnau Guadall
  • 327
  • 1
  • 4
  • 17

1 Answers1

5

I found a solution for this case, the key is the property allowInvalid

{
  data: 'bumper',          
  type: 'dropdown',
  allowInvalid: false,
  source: ['Red', 'Blue', 'Green']
}

If you put "allowInvalid: false" this propierty don't allow to press Enter to commit and the changes and therefore doesn't save until you choose a valid option which is what I need.

Here is the Fiddle with the problem solved if anyone needs some similar.

Arnau Guadall
  • 327
  • 1
  • 4
  • 17
  • great, now mark your answer solved so that people know it's the correct one – ZekeDroid May 04 '15 at 15:46
  • "You can accept your own answer tomorrow" I will do it tomorrow. If you think the same you can also answer unseful. – Arnau Guadall May 05 '15 at 06:15
  • Can I attach/provide a dropdown only for a single cell or single row and not for an entire column using any renderer or dynamic function. I havent been able to do that. – Gary Oct 11 '16 at 06:31
  • 1
    It would also be nice to have an option to not let the user type at all. – jaredbaszler Dec 23 '16 at 16:02