Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

data-slot

Arguments: grid-column

Returns the name of a slot that holds values to be displayed in cells of a grid-column, or else nil if this property is not being used. The value may be set at creation time by passing the data-slot initarg, or any time later by calling (setf data-slot). The default value is nil.

This property will be used when reading cell values only if the default read-cell-value method is not overridden and the grid-column has no data-reader function. It will be used when writing cell values only if the default write-cell-value method is not overriden and the grid-column has no data-writer function.

If this property is used, then when a grid cell is drawn, the value to display is found by calling slot-value with the data-object of the grid-row along with this slot name. If the user interactively edits the value in a grid cell, the new value is written back into application data by calling (setf slot-value) with the data-object of the grid-row along with this slot name and the new value.

It is usually preferable to use data-reader and data-writer functions because they will trigger the usual side effects of a slot's reader and writer functions. But data-slot can be useful for slots that do not have reader and writer functions, or when these functions are not known.

A special feature of a data-slot value is that it may indirectly access a slot of an object that's stored in a slot of the grid-row's data-object. This is done by using a value that is a list of slot names rather than a single slot name. The first slot name in the list should be a slot of the grid-row's data-object, the second slot name in the list should be a slot of the object that is found in the first slot, and so on. For example, if the data-object of each grid row is a patient object, and this grid column is editing the hospital of each patient, then the column's data-slot might be the list (hospital ceo phone-number) to access the phone number slot of the object that's in the CEO slot of the object that's in the hospital slot of the patient of each grid row. A class-grid makes use of this feature internally, but an application could use it directly as well.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version