有没有办法在 ag-grid 单元格中强加maxLength文本,类似于普通输入元素上的文本?
<input maxlength="220"/>
未找到相关文档。此外,在我看来,不需要特殊情况和更多细节。谢谢!
是的,您可以控制输入数据的完整流程,但您必须为此创建自己的数据流cellEditor
。
所以 - 进行简单的输入验证应该不难。
为了满足您的要求,您必须处理组件中的一项功能:
// Gets called once when editing is finished (eg if enter is pressed).
// If you return true, then the result of the edit will be ignored.
isCancelAfterEnd?(): boolean;
isCancelAfterEnd() {
return !this.isValid(this.eInput.value);
}
isValid(value) {
return value.length <= this.maxLength;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句