Servis-Rhino 4211B Betriebsanweisung Seite 182

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 298
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 181
called, it is the responsibility of the function to set the widget to contain the data value. Notice that
in the widget description, we can add the data-dojo-attach-point option. This creates a
variable which can be accessed in the setCellValue callback through
this.<variableName>. This will be the object reference to the new widget.
Imagine that the cell is defined to have a button contained within it. This may look like the
following column definition:
{ field: "name", name: "Actions", widgetsInCell: true,
decorator: function() {
return "<div data-dojo-type='dijit/form/Button' data-dojo-attach-point='btn' data-dojo-
props='label: \"Delete\"'></div>";
},
Now suppose we want to handle an event on a button click. We can do that through the
"getCellWidgetConnects()" method that is also added to the column definition:
getCellWidgetConnects: function(cellWidget, cell) {
return [
[ cellWidget.btn, 'onClick', function(e) {
debugger;
cell.row.grid.store.remove(cell.row.id);
}]
];
}
The notion here is that the getCellWidgetConnects function returns an array of "connection"
definitions. Each connection definition defines the widget, event and callback function to be
managed. When the callback function is invoked, it has a copy of the cellWidget and cell in
its context.
gridx/modules/ColumnResizer
This module allows columns to be resized horizontally. When the mouse is moved to the area
between columns on the header, the columns can then be dragged left or right.
Among its more interesting properties are:
detectWidth – The width (in pixels) that a mouse entry to the left or right of the
separator will be detected as a resize potential request.
gridx/modules/Edit
The Edit Module allows for editing of cells within the grid. Be sure and AMD include
gridx/modules/Edit.
When a grid includes the Edit module, this does not mean that all the cells are immediately editable.
Instead, we must tell the grid which columns contain editable fields. We do this by setting the
column property called editable to true. The default is false which means that cells in that
column are not editable.
When a cell is to be edited, a new instance of a Dojo widget (Dijit) is created at the location of the
cell on the screen. This widget is responsible for showing the current value and allowing the user to
change that value. By default, the widget used is an instance of dijit/form/TextBox
however different widget types can be used. The property called editor should be set to the
String name of the Dijit class to be used. Remember to define an AMD include of this class type
if it is used. Another column property called editorArgs can be used to supply properties to the
widget named in editor. The editorArgs property is an object which the following
properties:
Page 182
Seitenansicht 181
1 2 ... 177 178 179 180 181 182 183 184 185 186 187 ... 297 298

Kommentare zu diesen Handbüchern

Keine Kommentare