anchor.diff:  [classname]#ExternalResource# are currently supported for images in
   [classname]#Grid#.
   
  -ifdef::web[]
   +
   [source, java]
   ----
  
positive.code: 
      });
      cell.setComponent(filterField);
  
  }
  ----
  
  [[components.grid.sorting]]
  == Sorting
  
negative.code:               .then(nameColumn, SortDirection.DESCENDING));
  ----
  
  
  [[components.grid.editing]]
  == Editing Items Inside Grid
  
  Grid supports line-based editing, where double-clicking a row opens the row
  editor. In the editor, the input fields can be edited, as well as navigated with
  kbd:[Tab] and kbd:[Shift+Tab] keys. If validation fails, an error is displayed and the user
  can correct the inputs.
  
  The [classname]#Editor# is accessible via [methodname]#getEditor()#, and to enable editing, you need to call [methodname]#setEnabled(true) on it.
  
  The editor is based on [classname]#Binder# which is used to bind the data
  to the editor. See <<dummy/../../../framework/datamodel/datamodel-forms.asciidoc#datamodel.forms.beans,"Binding Beans to Forms">> for more information on setting up field components and validation by using [classname]#Binder.
  The [classname]#Binder# needs to be set with [methodname]#setBinder# in [classname]#Editor#.
  
  [source, java]
  ----
  List<Todo> items = Arrays.asList(new Todo("Done task", true),
          new Todo("Not done", false));
  
  Grid<Todo> grid = new Grid<>();
  
  TextField taskField = new TextField();
  CheckBox doneField = new CheckBox();
  Binder<Todo> binder = new Binder<>();
  
  binder.bind(taskField, Todo::getTask, Todo::setTask);
  binder.bind(doneField, Todo::isDone, Todo::setDone);
  
  grid.getEditor().setBinder(binder);
  grid.getEditor().setEnabled(true);
  
  Column<Todo, String> column = grid
          .addColumn(todo -> String.valueOf(todo.isDone()));
  column.setWidth(75);
  column.setEditorComponent(doneField);
  
  grid.addColumn(Todo::getTask).setEditorComponent(taskField);
  ----
  
  It is possible to customize the used editor component for each column and row,
  by using [methodname]#setEditorComponentGenerator(EditorComponentGenerator)# in
  [classname]#Column#.
  
  
  [[components.grid.editing.buffered]]
  === Buffered / Unbuffered Mode
  
  Grid supports two editor modes - buffered and unbuffered. The default mode is
  buffered. The mode can be changed with [methodname]#setBuffered(false)#.
  
  In the buffered mode, editor has two buttons visible: a [guibutton]#Save# button that commits
  the modifications to the bean and closes the editor and a [guibutton]#Cancel# button
  discards the changes and exits the editor.
  
  Editor in buffered mode is illustrated in <<figure.components.grid.editing>>.
  
  [[figure.components.grid.editing]]
  .Editing a Grid Row
  image::img/grid-editor-basic.png[width=50%, scaledwidth=75%]
  
  
  In the unbuffered mode, the editor has no buttons and all changed data is committed directly
  to the data provider. If another row is clicked, the editor for the current row is closed and
  a row editor for the clicked row is opened.
  
  
  [[components.grid.editing.captions]]
  === Customizing Editor Buttons
  
  