[]
Forguncy.Plugin.UserControlContainerBase
可以把组件作为子元素的单元格类型基类。
↳ UserControlContainerBase
• new UserControlContainerBase(...params)
| 属性名 | 类型 |
|---|---|
...params |
any[] |
• CellElement: CellContentElement<object>
在设计器中设置的单元格数据。
• ID: string
单元格的唯一键。
• IsInMasterPage: boolean
指定单元格是否在母版页中。
• designerPreviewCustomArgs: unknown[]
设计时预览自定义参数
CellTypeBase.designerPreviewCustomArgs
• isAttachmentCell: () => boolean
▸ (): boolean
是否是附件单元格
boolean
• isAutoFitHeight: () => boolean
▸ (): boolean
高度是否是自适应模式
boolean
• isAutoFitWidth: () => boolean
▸ (): boolean
宽度是否是自适应模式
boolean
• isDesignerPreview: boolean
是否是设计时预览
CellTypeBase.isDesignerPreview
• showDesignerPreviewError: (message: string) => void
▸ (message): void
在设计时预览里面显示错误信息
| 属性名 | 类型 |
|---|---|
message |
string |
void
CellTypeBase.showDesignerPreviewError
• get hasDestroyed(): boolean
判断单元格是否已经被销毁。
boolean
CellTypeBase.hasDestroyed
▸ Protected addUserControl(containerDivID, userControlInfo): any
添加组件。
| 属性名 | 类型 | 说明 |
|---|---|---|
containerDivID |
string |
容纳组件的父容器的ID, 在调用该方法前,需要创建该元素。 |
userControlInfo |
any |
组件信息对象,在设计中由有[UserControlInfoProperty]标签的属性或参数生成。 |
any
▸ Protected checkAuthority(scope): boolean
检查当前用户对于单元是否有可见或可用权限。
| 属性名 | 类型 | 说明 |
|---|---|---|
scope |
UIPermissionScope |
单元格权限类型,如可用性权限。 |
boolean
如果当前用户有权限返回True,否则返回False。
▸ Protected checkRoleAuthority(allowRoles): boolean
检查当前用户是否在有权限的角色列表中。
| 属性名 | 类型 | 说明 |
|---|---|---|
allowRoles |
string[] |
有权限的角色列表。 |
boolean
如果当前用户有权限返回True,否则返回False。
CellTypeBase.checkRoleAuthority
▸ clearContextVariableValue(variableName): void
Internal use
| 属性名 | 类型 |
|---|---|
variableName |
string |
void
CellTypeBase.clearContextVariableValue
▸ commitValue(): void
提交该单元格类型的值。当单元格类型的值由UI改变时,调用此方法来提交值。
void
▸ createContent(): JQuery
创建该单元格类型的元素。需要在子类实现。
JQuery
jQuery,包含单元格类型元素的容器。
▸ destroy(): void
销毁这个单元格类型。如果这个单元格在页面跳转时需要做一些事情,则实现此方法。
void
▸ Protected destroyUserControl(containerDivID): any
删除组件。
| 属性名 | 类型 | 说明 |
|---|---|---|
containerDivID |
string |
容纳组件的父容器的ID。 |
any
▸ disable(): void
禁用这个单元格类型。如果此单元类型支持禁用状态,则实现此方法。
void
▸ enable(): void
启用这个单元格类型。如果此单元类型支持禁用状态,则实现此方法。
void
▸ evaluateFormula(formula): any
计算公式的值。
| 属性名 | 类型 | 说明 |
|---|---|---|
formula |
any |
公式。 |
any
计算结果。
▸ executeCommand(commands, context?): void
执行一组命令。当需要在子类中执行命令时调用此方法。
| 属性名 | 类型 | 说明 |
|---|---|---|
commands |
object[] |
一组命令的信息。 |
context? |
CommandContext |
可选参数。命令执行的上下文信息。 |
void
▸ executeCustomCommandObject(command, initParam, eventType?, callbackOnCommandCompleted?, commandId?): any
执行自定义命令对象列表。
| 属性名 | 类型 | 说明 |
|---|---|---|
command |
ICustomCommandObject |
命令。 |
initParam |
Object |
上下文参数值。 |
eventType? |
string |
事件类型(可选,用于区分不同命令)。 |
callbackOnCommandCompleted? |
Function |
命令执行完成时回调函数(可选)。 |
commandId? |
string |
- |
any
CellTypeBase.executeCustomCommandObject
▸ getApplicationResource(key, ...args): string
获取应用资源
| 属性名 | 类型 | 说明 |
|---|---|---|
key |
string |
资源名称 |
...args |
string[] |
占位符的值 |
string
CellTypeBase.getApplicationResource
▸ getBindingDataSourceValue(bindingDataSourceModel, options, callback, reloadWhenDependenceChanged?): void
获取数据库数据。
| 属性名 | 类型 | 说明 |
|---|---|---|
bindingDataSourceModel |
any |
数据源查询模型,从设计器的BindingDataSourceProperty生成。 |
options |
queryDataOption |
查询配置。 |
callback |
(data: any) => void |
查询结果回调 |
reloadWhenDependenceChanged? |
boolean |
当依赖的单元格发生变化时,callback会被再次调用 |
void
CellTypeBase.getBindingDataSourceValue
▸ getContainer(): JQuery
获取单元格类型元素的容器。
JQuery
▸ getDebugValue(): any
获取该单元格在“调试:页面元素”中的值。
any
调试值
▸ getDefaultValue(): ICellTypeDefaultValue
获取该单元类型的默认值。页面加载后,单元格会显示默认值。如果默认值不是在设计器中设置的单元格值,则实现此方法。
默认值
▸ getElementTabIndex(): number
获取单元格的tab键顺序。
number
Tab键顺序值。
CellTypeBase.getElementTabIndex
▸ getFormulaCalcContext(): FormulaCalcContext
获取用于公式计算的数据上下文。
CellTypeBase.getFormulaCalcContext
▸ getPluginResource(key, ...args): string
获取插件资源
| 属性名 | 类型 | 说明 |
|---|---|---|
key |
string |
资源名称 |
...args |
string[] |
占位符的值 |
string
CellTypeBase.getPluginResource
▸ Protected getUIPermission(scope): UIPermission
获取单元格的可见或可用权限信息。
| 属性名 | 类型 | 说明 |
|---|---|---|
scope |
UIPermissionScope |
单元格权限类型,如可用性权限。 |
▸ getValidateResult(value, validationInfo): Promise<ForguncyDataValidateResult>
获取验证结果。
| 属性名 | 类型 | 说明 |
|---|---|---|
value |
any |
需要校验的值。 |
validationInfo |
ForguncyDataValidationInfo |
校验信息。 |
Promise<ForguncyDataValidateResult>
校验结果。
CellTypeBase.getValidateResult
▸ Protected getValueFromElement(): any
获取该单元类型的值。如果此单元格类型更改单元格的值,则实现此方法。
any
单元格的值。
CellTypeBase.getValueFromElement
▸ hasFocus(): boolean
获取该单元类型是否具有焦点。需要在子类实现。
boolean
▸ hideValidateTooltip(): void
隐藏数据校验的Tooltip。
void
CellTypeBase.hideValidateTooltip
▸ isDisabled(): boolean
获取该单元类型是否禁用。
boolean
▸ isReadOnly(): boolean
获取该单元类型是否只读。
boolean
▸ onBindingDataSourceDependenceCellValueChanged(bindingDataSourceModel, callback): void
当数据源引用的单元格值发生变更。每次执行的函数。
| 属性名 | 类型 |
|---|---|
bindingDataSourceModel |
any |
callback |
Function |
void
CellTypeBase.onBindingDataSourceDependenceCellValueChanged
▸ onBindingTableChanged(tableName): void
如果单元格绑定的数据源发生变化,可以通过重写此方法重新加载数据
| 属性名 | 类型 | 说明 |
|---|---|---|
tableName |
string |
变更的表名 |
void
CellTypeBase.onBindingTableChanged
▸ onDependenceCellValueChanged(valueChangedCallback): void
附加一个处理函数在依赖的单元格的值发生变化时进行处理。如果c#类实现了IDependenceCells接口,则在子类中通过该方法附加一个处理函数。
| 属性名 | 类型 | 说明 |
|---|---|---|
valueChangedCallback |
Function |
当依赖单元值发生变化时,每次执行的函数。 |
void
CellTypeBase.onDependenceCellValueChanged
▸ onFormulaResultChanged(formula, callback, calcImmediately?): any
在公式引用的单元格值发生变更时,重新计算公式的值。
| 属性名 | 类型 | 说明 |
|---|---|---|
formula |
any |
公式 |
callback |
(value: any) => void |
公式结果回调 |
calcImmediately? |
boolean |
是否立即计算,并调用回调函数,默认为true |
any
CellTypeBase.onFormulaResultChanged
▸ onLoad(): void
如果这个单元格需要在所有单元格创建完成并添加到页面之后做一些事情,则实现此方法。
void
▸ onPageLoaded(info): void
如果这个单元格需要在所有单元格创建完成并添加到页面之后做一些事情,则实现此方法。
| 属性名 | 类型 |
|---|---|
info |
CellTypeInfo |
void
▸ reload(): void
重新加载此单元格类型的数据。如果该单元格类型使用表或视图的数据,则实现此方法。当表的数据可能发生更改时,将触发此方法。
void
▸ setBackColor(color): void
设置单元格的背景色。
| 属性名 | 类型 |
|---|---|
color |
string |
void
▸ setContextVariableValue(variableName, value): void
Internal use
| 属性名 | 类型 |
|---|---|
variableName |
string |
value |
any |
void
CellTypeBase.setContextVariableValue
▸ setFocus(): void
设置焦点到该单元格类型。需要在子类实现。
void
▸ setFontStyle(styleInfo): void
为该单元格类型设置字体样式。如果该单元格类型显示单元格的字体设置,则实现此方法。
| 属性名 | 类型 | 说明 |
|---|---|---|
styleInfo |
StyleMetaData |
新的字体样式 |
void
▸ setReadOnly(value): void
设置单元格类型的只读状态。如果该单元格类型支持只读模式,则实现此方法
| 属性名 | 类型 | 说明 |
|---|---|---|
value |
boolean |
是否只读? |
void
▸ Protected setTabIndexToElement(tabIndex): void
设置单元格的tab键顺序。在基类中,会给单元格类型里的button,input,a和textarea元素设置tabindex,如果插件中需要给其他类型的元素设置tabindex,则需要重写该方法。
| 属性名 | 类型 | 说明 |
|---|---|---|
tabIndex |
number |
Tab键顺序值。 |
void
CellTypeBase.setTabIndexToElement
▸ setValueToElement(jelement, value): void
设置该单元类型的值。如果单元格的值发生更改,该单元格需要做出改动,则实现此方法。
| 属性名 | 类型 | 说明 |
|---|---|---|
jelement |
JQuery |
- |
value |
any |
赋予给单元格的值。 |
void
CellTypeBase.setValueToElement
▸ validate(): void
数据校验。
void