Class EditorItem<TModel, TValue>
- Namespace
- BootstrapBlazor.Components
- Assembly
- BootstrapBlazor.dll
EditorItem 组件
public class EditorItem<TModel, TValue> : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IEditorItem
Type Parameters
TModel
TValue
- Inheritance
-
EditorItem<TModel, TValue>
- Implements
- Inherited Members
- Extension Methods
Remarks
用于 EditorForm 的 FieldItems 模板内
Constructors
EditorItem()
public EditorItem()
Properties
ComponentParameters
获得/设置 组件自定义类型参数集合 默认为 null
[Parameter]
public IEnumerable<KeyValuePair<string, object>>? ComponentParameters { get; set; }
Property Value
ComponentType
获得/设置 组件类型 默认为 null
[Parameter]
public Type? ComponentType { get; set; }
Property Value
EditTemplate
获得/设置 编辑模板
[Parameter]
public RenderFragment<TModel>? EditTemplate { get; set; }
Property Value
- RenderFragment<TModel>
Editable
获得/设置 当前编辑项是否可编辑 默认为 true
[Parameter]
[Obsolete("已弃用,是否可编辑改用 Readonly 参数,是否可见改用 Ignore 参数; Deprecated If it is editable, use the Readonly parameter. If it is visible, use the Ignore parameter.")]
public bool Editable { get; set; }
Property Value
Field
获得/设置 绑定字段值
[Parameter]
public TValue? Field { get; set; }
Property Value
- TValue
FieldChanged
获得/设置 绑定字段值变化回调委托
[Parameter]
public EventCallback<TValue> FieldChanged { get; set; }
Property Value
- EventCallback<TValue>
FieldExpression
获得/设置 ValueExpression 表达式
[Parameter]
public Expression<Func<TValue>>? FieldExpression { get; set; }
Property Value
- Expression<Func<TValue>>
GroupName
获得/设置 当前属性分组
[Parameter]
public string? GroupName { get; set; }
Property Value
GroupOrder
获得/设置 当前属性分组排序 默认 0
[Parameter]
public int GroupOrder { get; set; }
Property Value
Ignore
获得/设置 当前编辑项是否忽略 默认为 false 当设置为 true 时 UI 不生成此列
[Parameter]
public bool? Ignore { get; set; }
Property Value
- bool?
IsPopover
获得/设置 是否使用 Popover 渲染下拉框 默认 false
[Parameter]
public bool IsPopover { get; set; }
Property Value
Items
获得/设置 额外数据源一般用于下拉框或者 CheckboxList 这种需要额外配置数据源组件使用
[Parameter]
public IEnumerable<SelectedItem>? Items { get; set; }
Property Value
Lookup
获得/设置 字典数据源 常用于外键自动转换为名称操作
[Parameter]
public IEnumerable<SelectedItem>? Lookup { get; set; }
Property Value
LookupServiceData
获得/设置 ILookupService 服务获取 Lookup 数据集合键值自定义数据,通过 LookupServiceKey 指定键值
[Parameter]
public object? LookupServiceData { get; set; }
Property Value
LookupServiceKey
获得/设置 ILookupService 服务获取 Lookup 数据集合键值 常用于外键自动转换为名称操作,可以通过 LookupServiceData 传递自定义数据
[Parameter]
public string? LookupServiceKey { get; set; }
Property Value
LookupStringComparison
获得/设置 字典数据源字符串比较规则 默认 StringComparison.OrdinalIgnoreCase 大小写不敏感
[Parameter]
public StringComparison LookupStringComparison { get; set; }
Property Value
Order
获得/设置 显示顺序
[Parameter]
public int Order { get; set; }
Property Value
PlaceHolder
获得/设置 placeholder 文本 默认为 null
[Parameter]
public string? PlaceHolder { get; set; }
Property Value
PropertyType
获得/设置 绑定列类型
public Type? PropertyType { get; set; }
Property Value
Readonly
获得/设置 当前编辑项是否只读 默认为 false
[Parameter]
public bool? Readonly { get; set; }
Property Value
- bool?
Rows
获得/设置 Textarea行数
[Parameter]
public int Rows { get; set; }
Property Value
ShowLabelTooltip
获得/设置 是否显示标签 Tooltip 多用于标签文字过长导致裁减时使用 默认 null
[Parameter]
public bool? ShowLabelTooltip { get; set; }
Property Value
- bool?
ShowSearchWhenSelect
获得/设置 字段数据源下拉框是否显示搜索栏 默认 false 不显示
[Parameter]
public bool ShowSearchWhenSelect { get; set; }
Property Value
SkipValidate
获得/设置 是否不进行验证 默认为 false
[Parameter]
public bool SkipValidate { get; set; }
Property Value
Step
获得/设置 步长 默认为 null 设置 any 时忽略检查
[Parameter]
public string? Step { get; set; }
Property Value
Text
获得/设置 表头显示文字
[Parameter]
public string? Text { get; set; }
Property Value
ValidateRules
获得/设置 自定义验证集合
[Parameter]
public List<IValidator>? ValidateRules { get; set; }
Property Value
Methods
GetDisplayName()
获取绑定字段显示名称方法
public virtual string GetDisplayName()
Returns
GetFieldName()
获取绑定字段信息方法
public string GetFieldName()
Returns
OnInitialized()
OnInitialized 方法
protected override void OnInitialized()