From ea6cb78302a68b030168f5e646ffe019bbb1f08e Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sun, 28 Oct 2018 16:04:25 +0800 Subject: [PATCH] patch docs for #604 --- docs/columns.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/columns.md b/docs/columns.md index aeafc5b..34b10c0 100644 --- a/docs/columns.md +++ b/docs/columns.md @@ -553,6 +553,28 @@ The return value can be a bool or an object. If your validation is pass, return } ``` +If you want to perform a asycn validation, you can do it like this: +```js +{ + // omit... + validator: (newValue, row, column, done) => { + settimeout(() => { + // async validation ok + return done(); + + // async validation not ok + return done({ + valid: false, + message: 'SOME_REASON_HERE' + }); + + }, 2000); + return { async: true }; + } +} +``` + + ## column.editCellStyle - [Object | Function] You can use `column.editCellStyle` to custom the style of `` when cell editing. It like most of customizable functionality, it also accept a callback function with following params: