fixed: column drag issue.

optimized: documentation.
This commit is contained in:
2024-01-26 14:09:52 +08:00
parent 0b9b322b80
commit 984496e08e
5 changed files with 313 additions and 78 deletions

25
lib/ui/grid/grid.d.ts vendored
View File

@@ -24,6 +24,22 @@ interface GridSourceItem {
text: string;
}
/** Grid 语言资源接口 */
interface GridLanguages {
/**
* “所有”文本
*
* @default `( All )`
*/
all: string;
/** “确定”文本,默认值 OK */
ok: string;
/** “重置”文本,默认值 Reset */
reset: string;
/** “空”文本,默认值 ( Null ) */
null: string
}
/** 列排序枚举 */
declare enum GridColumnDirection {
/** 倒序 */
@@ -70,7 +86,7 @@ export class Grid {
/** 列定义的数组 */
columns: Array<GridColumnDefinition>;
/** 多语言资源对象 */
langs?: { all: string, ok: string, reset: string };
langs?: GridLanguages;
/** 行数大于等于该值则启用虚模式,默认值 100 */
virtualCount?: Number;
/** 表格行高,默认值 36 */
@@ -112,29 +128,34 @@ export class Grid {
* 即将选中行时触发,返回 false、null、undefined、0 等则取消选中动作
* @param index 即将选中的行索引
* @param colIndex 即将选中的列索引
* @eventProperty
*/
willSelect?: (index: Number, colIndex: Number) => boolean;
/**
* 单元格单击时触发colIndex 为 -1 则表示点击的是行的空白处,返回 false 则取消事件冒泡
* @param index 点击的行索引
* @param colIndex 点击的列索引
* @eventProperty
*/
cellClicked?: (index: Number, colIndex: Number) => boolean;
/**
* 选中行发生变化时触发的事件
* @param index 选中的行索引
* @eventProperty
*/
onSelectedRowChanged?: (index?: Number) => void;
/**
* 单元格双击时触发的事件colIndex 为 -1 则表示点击的是行的空白处
* @param index 双击的行索引
* @param colIndex 双击的列索引
* @eventProperty
*/
onCellDblClicked?: (index: Number, colIndex: Number) => void;
/**
* 行双击时触发的事件
* @param index 双击的行索引
* @eventProperty
*/
onRowDblClicked?: (index: Number) => void;
/**
@@ -145,11 +166,13 @@ export class Grid {
* "sort" 为发生列排序事件,此时 value 为 1升序或 -1倒序
* @param colIndex 发生变化事件的列索引
* @param value 变化的值
* @eventProperty
*/
onColumnChanged?: (type: GridColumnColumnEvent, colIndex: Number, value: Number | GridColumnDirection) => void;
/**
* 列滚动时触发的事件
* @param e 滚动事件对象
* @eventProperty
*/
onBodyScrolled?: (e: Event) => void;