Update FilterSortEditDoc.vue

pull/4899/head
tugcekucukoglu 2023-11-27 09:46:31 +03:00
parent f299fdaf01
commit 21a88a3d32
1 changed files with 43 additions and 0 deletions

View File

@ -141,6 +141,20 @@ export default {
event.preventDefault();
break;
}
},
isPositiveInteger(val) {
let str = String(val);
str = str.trim();
if (!str) {
return false;
}
str = str.replace(/^0+/, '') || '0';
var n = Math.floor(Number(str));
return n !== Infinity && String(n) === str && n >= 0;
}
}
};
@ -215,6 +229,21 @@ const onCellEditComplete = (event) => {
}
};
const isPositiveInteger = (val) => {
let str = String(val);
str = str.trim();
if (!str) {
return false;
}
str = str.replace(/^0+/, '') || '0';
var n = Math.floor(Number(str));
return n !== Infinity && String(n) === str && n >= 0;
};
<\/script>
`,
data: `
@ -261,6 +290,20 @@ const onCellEditComplete = (event) => {
else event.preventDefault();
break;
}
},
isPositiveInteger(val) {
let str = String(val);
str = str.trim();
if (!str) {
return false;
}
str = str.replace(/^0+/, '') || '0';
var n = Math.floor(Number(str));
return n !== Infinity && String(n) === str && n >= 0;
}
}
};