Server Validation Demo

With Server Validation, you provide AdapTable with a function that returns a Promise and will run (presumably server-side) each time a cell is edited allowing you to perform advanced validation.

The return value can be: nothing (the edit works - or you want to 'swallow' it), the old value (validation failed) or a differnt value altogether (in advanced scenarios). You can additionally provide a Validation Message.

This example has 3 Server Validation Rules for Item Count: (1) Edits above 25 are rejected and changed to 25; (2) Edits below 5 are rejected and changed to 5; (3) Any edit of 17 is (bizarrely) rejected outright.

Note: Cell Validation takes precedence: we have also created a Cell Validation rule that an edit cannot increase in value by 15; if that rule fails then no Server Validation is run.

AdapTable Help Resources: