1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| if ( cellContent.match(/^\d\d[\/-]\d\d[\/-]\d\d\d\d$/) ) {
this.sortFunction[cellCpt]["ASC"] = this._sortStringASC;
this.sortFunction[cellCpt]["DESC"] = this._sortStringDESC;
dataType = 'date';
// nombre ou monnaie
// } else if ( cellContent.match(/^[0-9$£fF\.\s-]+$/) ) {
// } else if ( cellContent.match(/^[0-9$£fF\,\s-]+$/) ) {
} else if ( cellContent.match( /^(\d+)$)|(^(\d{1,3}[ ,\.](\d{3}[ ,\.])*\d{3}|\d{1,3})$/ ) {
alert("Détermination nbre = " + cellContent);
this.sortFunction[cellCpt]["ASC"] = this._sortNumberASC;
this.sortFunction[cellCpt]["DESC"] = this._sortNumberDESC;
dataType = 'number';
// texte (string)
} else {
this.sortFunction[cellCpt]["ASC"] = this._sortStringASC;
this.sortFunction[cellCpt]["DESC"] = this._sortStringDESC;
dataType = 'string';
} |