API REFERENCE
SyGridDropZoneInput
Fields, allowed values, and APIs that use SyGridDropZoneInput.
Type definition
A question mark (?) marks an optional field; readonly marks a value you should not change directly. A union (|) accepts one of the listed forms. Functions are callbacks that Grid invokes at the relevant point.
export interface SyGridDropZoneInput {
readonly id: string;
readonly kind: 'grid' | 'external';
readonly element?: HTMLElement | string;
readonly grid?: HTMLElement;
readonly accepting?: boolean;
readonly schema?: {
readonly id: string;
readonly fields: ReadonlyArray<{ readonly field: string; readonly type: 'string' | 'number' | 'boolean' | 'date' | 'any'; readonly required: boolean }>;
readonly allowExtraFields: boolean;
};
readonly permit?: (request: {
readonly sourceZoneId: string;
readonly targetZoneId: string;
readonly mode: 'move' | 'copy';
readonly rowKey: string;
readonly row: unknown;
readonly context: unknown;
}) => { readonly allow: true } | { readonly allow: false; readonly detail: string };
readonly adapt?: (row: unknown, sourceZoneId: string) => unknown;
readonly consumes?: boolean;
readonly mode?: 'move' | 'copy';
readonly duplicateIds?: 'refuse' | 'skip' | 'replace';
readonly atomicity?: 'all-or-nothing' | 'best-effort';
readonly onDrop?: (target: unknown, commit: unknown) => void;
}APIs using this type
- registerDropZone
Registers a drop area for receiving rows and returns the registration result.