I want to save all table data,but how to validate(required), thanks
This is very well documented in the documentation
Here is an example from this documentation, which you should read.
//validator to prevent values divisible by five
var noDivideFive = functioncell, value, parameters){
//cell - the cell component for the edited cell
//value - the new input value of the cell
//parameters - the parameters passed in with the validator
return value % 5; //dont allow values divisible by 5;
}
//in your column definition for the column
{title:"Age", field:"age", editor:"input", validator:noDivideFive}
thanks for your help.
Can we do like this?
var isvalid = $("#the_table").tabulator("isvalid");
if(isvalid){
// todo something
}
@Rodbjartson
Hey @jiaqianliCn
The validation in tabulator does not work like this, it will not let you enter invalid data into the table in the first place so all data contained within the table is always valid (as long as it was valid in the first place when it was set with the setData function).
if validation fails the validationFailed callback is called and you can trigger an action from that
Most helpful comment
This is very well documented in the documentation
Here is an example from this documentation, which you should read.