Now my code looks like this and works perfectly
beforePaste: function (evt, ui) {
//sanitize pasted data.
var CM = this.getColModel(),
rows = ui.rows,
area = ui.areas[0],
c1 = area.c1;
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
for (var j = 0; j < row.length; j++) {
var column = CM[j + c1],
dt = column.dataType;
if (dt == "date") {
var $m = row[j].match(/^(\d+)-(\d+)-(\d+)$/);
var $new = $m[2] + "-" + $m[1] + "-" + $m[3];
row[j] = $new;
}
}
}
},
But i have one last question, is there a way to do the same but with the cell click and cell submit?