【问题标题】:Handsontable. Get a list of all validation errors掌上电脑。获取所有验证错误的列表
【发布时间】:2014-05-21 12:41:45
【问题描述】:

我想知道在提交数据之前是否可以在 handsontable 中获取所有验证错误的列表?

谢谢!

【问题讨论】:

标签: javascript handsontable


【解决方案1】:

为 afterValidate 事件添加监听器
http://handsontable.com/demo/validation.html
更多这里
https://github.com/warpech/jquery-handsontable/wiki/Events
afterValidate(isValid: Boolean, value: Mixed, row: Number, prop: String, source: String)

在处理函数之后,您可以编写 JQuery 选择器来提取错误数据。

更新根据要求

你像这样附加事件监听器,然后according to documentation

$('#your-handsontable-id').on('afterValidate', function(result){
   if(!result.isValid){
    alert('Take your pants off cause we have a problem boy! - value - '+ result.value +' row -' + result.row +' prop -' + result.prop+ +' source-'+result.source); 
   }
});

【讨论】:

  • 这很模糊。您能描述一下您将如何存储有关违反哪些验证规则的数据吗?
猜你喜欢
  • 2013-02-11
  • 2011-01-02
  • 1970-01-01
  • 1970-01-01
  • 2015-10-25
  • 2015-08-09
  • 2017-05-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多