[]
        
立即下载
(Showing Draft Content)

Forguncy.Forguncy.Plugin.UserControlContainerBase

类: UserControlContainerBase

Forguncy.Plugin.UserControlContainerBase

可以把组件作为子元素的单元格类型基类。

继承关系

构造方法

constructor

new UserControlContainerBase(...params)

参数

属性名 类型
...params any[]

继承自

CellTypeBase.constructor

属性

CellElement

CellElement: CellContentElement<object>

在设计器中设置的单元格数据。

继承自

CellTypeBase.CellElement


ID

ID: string

单元格的唯一键。

继承自

CellTypeBase.ID


IsInMasterPage

IsInMasterPage: boolean

指定单元格是否在母版页中。

继承自

CellTypeBase.IsInMasterPage


designerPreviewCustomArgs

designerPreviewCustomArgs: unknown[]

设计时预览自定义参数

继承自

CellTypeBase.designerPreviewCustomArgs


isAttachmentCell

isAttachmentCell: () => boolean

Type declaration

▸ (): boolean

是否是附件单元格

Returns

boolean

继承自

CellTypeBase.isAttachmentCell


isAutoFitHeight

isAutoFitHeight: () => boolean

Type declaration

▸ (): boolean

高度是否是自适应模式

Returns

boolean

继承自

CellTypeBase.isAutoFitHeight


isAutoFitWidth

isAutoFitWidth: () => boolean

Type declaration

▸ (): boolean

宽度是否是自适应模式

Returns

boolean

继承自

CellTypeBase.isAutoFitWidth


isDesignerPreview

isDesignerPreview: boolean

是否是设计时预览

继承自

CellTypeBase.isDesignerPreview


showDesignerPreviewError

showDesignerPreviewError: (message: string) => void

Type declaration

▸ (message): void

在设计时预览里面显示错误信息

Parameters
属性名 类型
message string
Returns

void

继承自

CellTypeBase.showDesignerPreviewError

Accessors

hasDestroyed

get hasDestroyed(): boolean

判断单元格是否已经被销毁。

返回值

boolean

继承自

CellTypeBase.hasDestroyed


isInListView

get isInListView(): boolean

单元格类型是否位于表格中。

Example

// 在自定义单元格类的OnPageLoaded方法中,判断是不是位于表格中。
public onPageLoaded(info) {
    if (this.isInListView) {
        this.addCustomClass('celltype1-listview');
        this.setDropDownAttributeInListView(this.getDropDownElement());
    }
    super.onPageLoaded(info);
}

返回值

boolean

继承自

CellTypeBase.isInListView


parentListView

get parentListView(): ListView

单元格类型所在的表格。

返回值

ListView

继承自

CellTypeBase.parentListView

方法

addUserControl

Protected addUserControl(containerDivID, userControlInfo): any

添加组件。

参数

属性名 类型 说明
containerDivID string 容纳组件的父容器的ID, 在调用该方法前,需要创建该元素。
userControlInfo any 组件信息对象,在设计中由有[UserControlInfoProperty]标签的属性或参数生成。

返回值

any


checkAuthority

Protected checkAuthority(scope): boolean

检查当前用户对于单元是否有可见或可用权限。

参数

属性名 类型 说明
scope UIPermissionScope 单元格权限类型,如可用性权限。

返回值

boolean

如果当前用户有权限返回True,否则返回False。

继承自

CellTypeBase.checkAuthority


checkPermissionGroupsAuthority

Protected checkPermissionGroupsAuthority(allowPermissionGroups): boolean

检查当前用户是否在有权限的权限组列表中。

参数

属性名 类型 说明
allowPermissionGroups string[] 有权限的权限组列表。

返回值

boolean

如果当前用户有权限返回True,否则返回False。

继承自

CellTypeBase.checkPermissionGroupsAuthority


checkRoleAuthority

Protected checkRoleAuthority(allowRoles): boolean

检查当前用户是否在有权限的角色列表中。

参数

属性名 类型 说明
allowRoles string[] 有权限的角色列表。

返回值

boolean

如果当前用户有权限返回True,否则返回False。

继承自

CellTypeBase.checkRoleAuthority


clearContextVariableValue

clearContextVariableValue(variableName): void

Internal use

参数

属性名 类型
variableName string

返回值

void

继承自

CellTypeBase.clearContextVariableValue


commitValue

commitValue(): void

提交该单元格类型的值。当单元格类型的值由UI改变时,调用此方法来提交值。

返回值

void

继承自

CellTypeBase.commitValue


createContent

createContent(): JQuery

创建该单元格类型的元素。需要在子类实现。

返回值

JQuery

jQuery,包含单元格类型元素的容器。

继承自

CellTypeBase.createContent


destroy

destroy(): void

销毁这个单元格类型。如果这个单元格在页面跳转时需要做一些事情,则实现此方法。

返回值

void

继承自

CellTypeBase.destroy


destroyUserControl

Protected destroyUserControl(containerDivID): any

删除组件。

参数

属性名 类型 说明
containerDivID string 容纳组件的父容器的ID。

返回值

any


disable

disable(): void

禁用这个单元格类型。如果此单元类型支持禁用状态,则实现此方法。

返回值

void

继承自

CellTypeBase.disable


enable

enable(): void

启用这个单元格类型。如果此单元类型支持禁用状态,则实现此方法。

返回值

void

继承自

CellTypeBase.enable


evaluateFormula

evaluateFormula(formula, listViewContext?): any

计算公式的值。

参数

属性名 类型 说明
formula any 公式。
listViewContext? ListViewContext 表格上下文,当单元格类型位于表格中,且公式引用了表格的单元格,该上下文指定计算哪一行的单元格。

返回值

any

计算结果。

继承自

CellTypeBase.evaluateFormula


executeCommand

executeCommand(commands, context?): void

执行一组命令。当需要在子类中执行命令时调用此方法。

参数

属性名 类型 说明
commands object[] 一组命令的信息。
context? CommandContext 可选参数。命令执行的上下文信息。

返回值

void

继承自

CellTypeBase.executeCommand


executeCustomCommandObject

executeCustomCommandObject(command, initParam, eventType?, callbackOnCommandCompleted?, commandId?): any

执行自定义命令对象列表。

参数

属性名 类型 说明
command ICustomCommandObject 命令。
initParam Object 上下文参数值。
eventType? string 事件类型(可选,用于区分不同命令)。
callbackOnCommandCompleted? Function 命令执行完成时回调函数(可选)。
commandId? string -

返回值

any

继承自

CellTypeBase.executeCustomCommandObject


getApplicationResource

getApplicationResource(key, ...args): string

获取应用资源

参数

属性名 类型 说明
key string 资源名称
...args string[] 占位符的值

返回值

string

继承自

CellTypeBase.getApplicationResource


getAutoFitHeightInListView

getAutoFitHeightInListView(value, text, cellStyle, context): number

获取在表格非编辑状态下的自适应行高。在基类中,该方法会返回默认显示文本的高度。

参数

属性名 类型 说明
value any 单元格的值。
text string 单元格的显示文本。
cellStyle ListViewCellStyle 单元格的样式信息。
context ListViewContext 表格上下文。

返回值

number

自适应行高。

继承自

CellTypeBase.getAutoFitHeightInListView


getAutoFitWidthInListView

getAutoFitWidthInListView(value, text, cellStyle, context): number

获取在表格非编辑状态下的自适应列宽。在基类中,该方法会返回默认显示文本的宽度。

Example

// 如果我们在单元格右侧绘制了一个下拉按钮,那么需要重写该方法。
getAutoFitWidthInListView(value, text, cellRect, cellStyle, context) {
    return super.getAutoFitWidthInListView(value, text, cellStyle, context) +
         (this.showDropDownIcon(context) ? this.getIconWidth() : 0);
}

参数

属性名 类型 说明
value any 单元格的值。
text string 单元格的显示文本。
cellStyle ListViewCellStyle 单元格的样式信息。
context ListViewContext 表格上下文。

返回值

number

自适应列宽。

继承自

CellTypeBase.getAutoFitWidthInListView


getBindingDataSourceValue

getBindingDataSourceValue(bindingDataSourceModel, options, callback, reloadWhenDependenceChanged?): void

获取数据库数据。

参数

属性名 类型 说明
bindingDataSourceModel any 数据源查询模型,从设计器的BindingDataSourceProperty生成。
options queryDataOption 查询配置。
callback (data: any) => void 查询结果回调
reloadWhenDependenceChanged? boolean 当依赖的单元格发生变化时,callback会被再次调用

返回值

void

继承自

CellTypeBase.getBindingDataSourceValue


getContainer

getContainer(): JQuery

获取单元格类型元素的容器。

返回值

JQuery

继承自

CellTypeBase.getContainer


getDebugValue

getDebugValue(): any

获取该单元格在“调试:页面元素”中的值。

返回值

any

调试值

继承自

CellTypeBase.getDebugValue


getDefaultValue

getDefaultValue(): ICellTypeDefaultValue

获取该单元类型的默认值。页面加载后,单元格会显示默认值。如果默认值不是在设计器中设置的单元格值,则实现此方法。

返回值

ICellTypeDefaultValue

默认值

继承自

CellTypeBase.getDefaultValue


getElementTabIndex

getElementTabIndex(): number

获取单元格的tab键顺序。

返回值

number

Tab键顺序值。

继承自

CellTypeBase.getElementTabIndex


getFormulaCalcContext

getFormulaCalcContext(): FormulaCalcContext

获取用于公式计算的数据上下文。

返回值

FormulaCalcContext

继承自

CellTypeBase.getFormulaCalcContext


getHitTestTypeInListView

getHitTestTypeInListView(x, y, cellRect, context): any

在表格中,非编辑状态下,返回命中测试的结果。在相关Mouse事件处理函数中可以按照命中测试的结果进行下一步操作。

Example

//例如,自定义选择器,在表格非编辑状态下,鼠标悬停在下拉按钮位置时,将光标变成pointer并更改下拉按钮样式。
private _hoverRowIndex = -1;
public getHitTestTypeInListView(x, y, cellRect, context) {
    if (context.cellState.isInvisible ||
        context.cellState.isReadOnly ||
        context.cellState.isDisabled) {
        return null;
    }

    if (this.showDropDownIcon(context) && x > cellRect.x + cellRect.width - this.getIconWidth()) {
        return 'DropDown';
    }
}

public onMouseMoveInListView(hitInfo, context) {
    if (hitInfo?.type === 'DropDown') {
        context.cursor = 'pointer';
        this._hoverRowIndex = context.rowIndex;
    } else {
        this._hoverRowIndex = -1;
    }

    super.onMouseMoveInListView(hitInfo, context);
}

public onMouseLeaveInListView(hitInfo, context) {
    this._hoverRowIndex = -1;
    super.onMouseLeaveInListView(hitInfo, context);
}

public paintInListView(ctx, value, cellRect, cellStyle, context) {
    const isHoverOnDropDown = context.rowIndex === this._hoverRowIndex;
    //Paint drop down and text
}

参数

属性名 类型 说明
x number 测试点的x坐标。
y number 测试点的y坐标。
cellRect Rect 单元格相对于Canvas的位置信息。
context ListViewContext 表格上下文。

返回值

any

测试的结果。比如,当前位置是下拉按钮,可以返回‘DropDown’。

继承自

CellTypeBase.getHitTestTypeInListView


getPermissionMode

Protected getPermissionMode(): PermissionMode

获取权限认证模式

返回值

PermissionMode

PermissionMode

继承自

CellTypeBase.getPermissionMode


getPluginResource

getPluginResource(key, ...args): string

获取插件资源

参数

属性名 类型 说明
key string 资源名称
...args string[] 占位符的值

返回值

string

继承自

CellTypeBase.getPluginResource


getTextByValue

getTextByValue(value, context?, format?, formattedData?): string

将值转换为文本。在某些单元格类型中,值与显示文本是不一样的,比如选择器,那么就需要重写该方法。

参数

属性名 类型 说明
value any 要转换的值。
context? ListViewContext 表格上下文。
format? string -
formattedData? object 格式化数据。

返回值

string

转换的文本。

继承自

CellTypeBase.getTextByValue


getUIPermission

Protected getUIPermission(scope): UIPermission

获取单元格的可见或可用权限信息。

参数

属性名 类型 说明
scope UIPermissionScope 单元格权限类型,如可用性权限。

返回值

UIPermission

继承自

CellTypeBase.getUIPermission


getValidateResult

getValidateResult(value, validationInfo): Promise<ForguncyDataValidateResult>

获取验证结果。

参数

属性名 类型 说明
value any 需要校验的值。
validationInfo ForguncyDataValidationInfo 校验信息。

返回值

Promise<ForguncyDataValidateResult>

校验结果。

继承自

CellTypeBase.getValidateResult


getValidationErrorInListView

getValidationErrorInListView(value, context): string

返回数据校验错误信息。校验表格中的数据时会被调用。

参数

属性名 类型 说明
value any 要校验的值。
context ListViewContext 表格上下文。

返回值

string

错误信息,如果校验成功,则返回null。

继承自

CellTypeBase.getValidationErrorInListView


getValueByText

getValueByText(text, context?): any

将文本转换为值。在某些单元格类型中,值与显示文本是不一样的,比如选择器,那么就需要重写该方法。

Example

// 在配置项中根据text寻找item,如果没有找到,返回WrongParseResult。
public getValueByText(text, context) {
    if (this.isEmpty(text)) {
          return null;
    }

    const item = this.options.find(item => item.text == text);
    if (item) {
        return item.value;
    } else {
        return new Forguncy.Plugin.WrongParseResult(text);
    }
}

参数

属性名 类型 说明
text any 要转换的文本。
context? ListViewContext 表格上下文。

返回值

any

转换的值。

继承自

CellTypeBase.getValueByText


getValueFromElement

Protected getValueFromElement(): any

获取该单元类型的值。如果此单元格类型更改单元格的值,则实现此方法。

返回值

any

单元格的值。

继承自

CellTypeBase.getValueFromElement


hasFocus

hasFocus(): boolean

获取该单元类型是否具有焦点。需要在子类实现。

返回值

boolean

继承自

CellTypeBase.hasFocus


hideValidateTooltip

hideValidateTooltip(): void

隐藏数据校验的Tooltip。

返回值

void

继承自

CellTypeBase.hideValidateTooltip


isDisabled

isDisabled(): boolean

获取该单元类型是否禁用。

返回值

boolean

继承自

CellTypeBase.isDisabled


isReadOnly

isReadOnly(): boolean

获取该单元类型是否只读。

返回值

boolean

继承自

CellTypeBase.isReadOnly


isReservedKeyInListView

isReservedKeyInListView(event): boolean

在表格中,编辑状态,是否由单元格类型自己处理相关键盘事件。

Example

//在选择器中,按下Up,Down和Enter键时,不希望表格处理键盘事件,变更当前单元格。
public isReservedKeyInListView(event) {
    if (super.isReservedKeyInListView(event)) {
        return true;
    }

    return event.code === 'ArrowDown' ||
        event.code === 'ArrowUp' ||
        event.code === 'ArrowLeft' ||
        event.code === 'ArrowRight' ||
        (this._isDropDownOpened && event.code === 'Enter');
}

参数

属性名 类型 说明
event KeyboardEvent 键盘事件参数。

返回值

boolean

是否由单元格类型自己处理相关键盘事件。

继承自

CellTypeBase.isReservedKeyInListView


moveCursorToEnd

moveCursorToEnd(): void

清除编辑器里的文本选择,并把光标移动至文本末尾。

返回值

void

继承自

CellTypeBase.moveCursorToEnd


onBindingDataSourceDependenceCellValueChanged

onBindingDataSourceDependenceCellValueChanged(bindingDataSourceModel, callback): void

当数据源引用的单元格值发生变更。每次执行的函数。

参数

属性名 类型
bindingDataSourceModel any
callback Function

返回值

void

继承自

CellTypeBase.onBindingDataSourceDependenceCellValueChanged


onBindingTableChanged

onBindingTableChanged(tableName): void

如果单元格绑定的数据源发生变化,可以通过重写此方法重新加载数据

参数

属性名 类型 说明
tableName string 变更的表名

返回值

void

继承自

CellTypeBase.onBindingTableChanged


onClickInListView

onClickInListView(hitInfo, context): void

在表格的非编辑状态下,处理鼠标点击事件。

Example

//例如,自定义选择器,在表格非编辑状态下,鼠标点击下拉按钮时,单元格进入编辑状态。点击清除按钮时,清除值。
public getHitTestTypeInListView(x, y, cellRect, context) {
    if (context.cellState.isInvisible ||
        context.cellState.isReadOnly ||
        context.cellState.isDisabled) {
        return null;
    }

    const dropDownRect = this.getDropDownRect(context);
    if (dropDownRect && x > dropDownRect.x && x < dropDownRect.x + dropDownRect.width) {
        return 'DropDown';
    }

    const deleteButtonRect = this.getDeleteButtonRect(context);
    if (deleteButtonRect && x > deleteButtonRect.x && x < deleteButtonRect.x + deleteButtonRect.width) {
        return 'DeleteButton';
    }
}

public onMouseMoveInListView(hitInfo, context) {
    if (hitInfo?.type === 'DropDown' || hitInfo?.type === 'DeleteButton') {
        context.cursor = 'pointer';
    }

    super.onMouseMoveInListView(hitInfo, context);
}

public onClickInListView(hitInfo, context) {
    if (hitInfo?.type === 'DropDown') {
        //使表格当前单元格进入编辑状态。
        this.parentListView.startEdit();
        return;
    }

    if (hitInfo?.type === 'DeleteButton') {
        //如果在onClickInListView方法中修改context.value的值,那么表格会更新该单元格的值。
        context.value = null;
        return;
    }
}

参数

属性名 类型 说明
hitInfo ListViewHitTestInfo 命中测试信息。
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.onClickInListView


onDependenceCellValueChanged

onDependenceCellValueChanged(valueChangedCallback): void

附加一个处理函数在依赖的单元格的值发生变化时进行处理。如果c#类实现了IDependenceCells接口,则在子类中通过该方法附加一个处理函数。

参数

属性名 类型 说明
valueChangedCallback Function 当依赖单元值发生变化时,每次执行的函数。

返回值

void

继承自

CellTypeBase.onDependenceCellValueChanged


onDestroyInListView

onDestroyInListView(context): void

在表格中,当切换当前单元格时,会调用该方法,用于销毁当前编辑器,并在随后为新的单元格创建新的编辑器。

参数

属性名 类型 说明
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.onDestroyInListView


onEditEndInListView

onEditEndInListView(context): void

在表格中,当单元格退出编辑状态时会调用该方法。

参数

属性名 类型 说明
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.onEditEndInListView


onEditStartInListView

onEditStartInListView(context): void

在表格中,当单元格进入编辑状态时会调用该方法。

参数

属性名 类型 说明
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.onEditStartInListView


onFormulaResultChanged

onFormulaResultChanged(formula, callback, calcImmediately?): any

在公式引用的单元格值发生变更时,重新计算公式的值。

参数

属性名 类型 说明
formula any 公式
callback (value: any) => void 公式结果回调
calcImmediately? boolean 是否立即计算,并调用回调函数,默认为true

返回值

any

继承自

CellTypeBase.onFormulaResultChanged


onListViewLoaded

onListViewLoaded(): void

当所处表格加载好后调用该方法。

返回值

void

继承自

CellTypeBase.onListViewLoaded


onLoad

onLoad(): void

如果这个单元格需要在所有单元格创建完成并添加到页面之后做一些事情,则实现此方法。

返回值

void

继承自

CellTypeBase.onLoad


onMouseDownInListView

onMouseDownInListView(hitInfo, context): void

在表格的非编辑状态下,处理鼠标按下事件。

参数

属性名 类型 说明
hitInfo ListViewHitTestInfo 命中测试信息。
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.onMouseDownInListView


onMouseLeaveInListView

onMouseLeaveInListView(hitInfo, context): void

在表格的非编辑状态下,处理鼠标离开单元格事件

Example

//例如,自定义选择器,在表格非编辑状态下,鼠标悬停在下拉按钮位置时,将光标变成pointer并更改下拉按钮样式。
private _hoverRowIndex = -1;
public getHitTestTypeInListView(x, y, cellRect, context) {
    if (context.cellState.isInvisible ||
        context.cellState.isReadOnly ||
        context.cellState.isDisabled) {
        return null;
    }

    if (this.showDropDownIcon(context) && x > cellRect.x + cellRect.width - this.getIconWidth()) {
        return 'DropDown';
    }
}

public onMouseMoveInListView(hitInfo, context) {
    if (hitInfo?.type === 'DropDown') {
        context.cursor = 'pointer';
        this._hoverRowIndex = context.rowIndex;
    } else {
        this._hoverRowIndex = -1;
    }

    super.onMouseMoveInListView(hitInfo, context);
}

public onMouseLeaveInListView(hitInfo, context) {
    this._hoverRowIndex = -1;
    super.onMouseLeaveInListView(hitInfo, context);
}

public paintInListView(ctx, value, cellRect, cellStyle, context) {
    const isHoverOnDropDown = context.rowIndex === this._hoverRowIndex;
    //Paint drop down and text
}

参数

属性名 类型 说明
hitInfo ListViewHitTestInfo 命中测试信息。
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.onMouseLeaveInListView


onMouseMoveInListView

onMouseMoveInListView(hitInfo, context): void

在表格的非编辑状态下,处理鼠标移动事件

Example

//例如,自定义选择器,在表格非编辑状态下,鼠标悬停在下拉按钮位置时,将光标变成pointer并更改下拉按钮样式。
private _hoverRowIndex = -1;
public getHitTestTypeInListView(x, y, cellRect, context) {
    if (context.cellState.isInvisible ||
        context.cellState.isReadOnly ||
        context.cellState.isDisabled) {
        return null;
    }

    if (this.showDropDownIcon(context) && x > cellRect.x + cellRect.width - this.getIconWidth()) {
        return 'DropDown';
    }
}

public onMouseMoveInListView(hitInfo, context) {
    if (hitInfo?.type === 'DropDown') {
        context.cursor = 'pointer';
        this._hoverRowIndex = context.rowIndex;
    } else {
        this._hoverRowIndex = -1;
    }

    super.onMouseMoveInListView(hitInfo, context);
}

public onMouseLeaveInListView(hitInfo, context) {
    this._hoverRowIndex = -1;
    super.onMouseLeaveInListView(hitInfo, context);
}

public paintInListView(ctx, value, cellRect, cellStyle, context) {
    const isHoverOnDropDown = context.rowIndex === this._hoverRowIndex;
    //Paint drop down and text
}

参数

属性名 类型 说明
hitInfo ListViewHitTestInfo 命中测试信息。
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.onMouseMoveInListView


onMouseUpInListView

onMouseUpInListView(hitInfo, context): void

在表格的非编辑状态下,处理鼠标抬起事件。

参数

属性名 类型 说明
hitInfo ListViewHitTestInfo 命中测试信息。
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.onMouseUpInListView


onPageLoaded

onPageLoaded(info): void

如果这个单元格需要在所有单元格创建完成并添加到页面之后做一些事情,则实现此方法。

参数

属性名 类型
info CellTypeInfo

返回值

void

继承自

CellTypeBase.onPageLoaded


paintInListView

paintInListView(ctx, value, cellRect, cellStyle, context): void

在Canvas中绘制单元格类型在表格中的非编辑状态。

Example

// 在单元格右侧绘制一个下拉按钮。
paintInListView(ctx, value, cellRect, cellStyle, context) {
    const iconWidth = this.showDropDownIcon(context) ? this.getIconWidth() : 0;
    const textWidth = cellRect.width - iconWidth;

    if (textWidth > 0) {
        const textRect = { ...cellRect };
        textRect.width = textWidth;
        super.paintInListView(ctx, value, textRect, cellStyle, context);
    }

    if (iconWidth > 0) {
        const url = this.getDropDownSvgUrl();
        const iconRect = {
            x: cellRect.x + cellRect.width - this._iconWidth - this._iconPadding,
            y: cellRect.y,
            width: this._iconWidth,
            height: cellRect.height
        };
        context.drawingHelper.paintSvg(url, "#a8abb2", ctx, iconRect, context);
    }
}

参数

属性名 类型 说明
ctx CanvasRenderingContext2D Canvas 2D渲染上下文。
value any 单元格的值。
cellRect Rect 单元格相对于Canvas的位置信息。
cellStyle ListViewCellStyle 单元格的样式信息。
context ListViewContext 表格上下文。

返回值

void

继承自

CellTypeBase.paintInListView


reload

reload(): void

重新加载此单元格类型的数据。如果该单元格类型使用表或视图的数据,则实现此方法。当表的数据可能发生更改时,将触发此方法。

返回值

void

继承自

CellTypeBase.reload


selectAll

selectAll(): void

全选编辑器的文本。

返回值

void

继承自

CellTypeBase.selectAll


setBackColor

setBackColor(color): void

设置单元格的背景色。

参数

属性名 类型
color string

返回值

void

继承自

CellTypeBase.setBackColor


setContextVariableValue

setContextVariableValue(variableName, value): void

Internal use

参数

属性名 类型
variableName string
value any

返回值

void

继承自

CellTypeBase.setContextVariableValue


setDropDownAttributeInListView

setDropDownAttributeInListView(elements): void

如果单元格类型在表格中使用且有下拉框,需要调用该方法设置一些属性。否则操作下拉框时,可能导致单元格退出编辑状态。

Example

//调用setDropDownAttributeInListView方法设置一些属性。
public onPageLoaded(info) {
    if (this.isInListView) {
        this.addCustomClass('celltype1-listview');
        this.setDropDownAttributeInListView(this.getDropDownElement());
    }
    super.onPageLoaded(info);
}

参数

属性名 类型 说明
elements HTMLElement[] 下拉框元素。

返回值

void

继承自

CellTypeBase.setDropDownAttributeInListView


setFocus

setFocus(): void

设置焦点到该单元格类型。需要在子类实现。

返回值

void

继承自

CellTypeBase.setFocus


setFontStyle

setFontStyle(styleInfo): void

为该单元格类型设置字体样式。如果该单元格类型显示单元格的字体设置,则实现此方法。

参数

属性名 类型 说明
styleInfo StyleMetaData 新的字体样式

返回值

void

继承自

CellTypeBase.setFontStyle


setReadOnly

setReadOnly(value): void

设置单元格类型的只读状态。如果该单元格类型支持只读模式,则实现此方法

参数

属性名 类型 说明
value boolean 是否只读?

返回值

void

继承自

CellTypeBase.setReadOnly


setTabIndexToElement

Protected setTabIndexToElement(tabIndex): void

设置单元格的tab键顺序。在基类中,会给单元格类型里的button,input,a和textarea元素设置tabindex,如果插件中需要给其他类型的元素设置tabindex,则需要重写该方法。

参数

属性名 类型 说明
tabIndex number Tab键顺序值。

返回值

void

继承自

CellTypeBase.setTabIndexToElement


setValueToElement

setValueToElement(jelement, value): void

设置该单元类型的值。如果单元格的值发生更改,该单元格需要做出改动,则实现此方法。

参数

属性名 类型 说明
jelement JQuery -
value any 赋予给单元格的值。

返回值

void

继承自

CellTypeBase.setValueToElement


validate

validate(): void

数据校验。

返回值

void

继承自

CellTypeBase.validate