סקר מחקר: נשמח לשמוע על החוויה שלך עם Blockly
לפתיחת הסקר
blockly > FieldNumber > doClassValidation_
שיטת FieldNumber.doClassValidation_()
חשוב לוודא שערך הקלט הוא מספר חוקי (חייב לעמוד במגבלות שהוגדרו בשדה).
Signature:
protected doClassValidation_(newValue?: any): number | null;
פרמטרים
פרמטר |
סוג |
תיאור |
newValue |
כל |
(אופציונלי) ערך הקלט. |
החזרות:
מספר | null
המספר תקין. אם הוא לא תקין, הערך הוא null.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-09-12 (שעון UTC).
[null,null,["עדכון אחרון: 2024-09-12 (שעון UTC)."],[[["`FieldNumber.doClassValidation_()` is a protected method used to validate the input value for a number field in Blockly."],["It ensures the input adheres to any constraints placed on the field, such as minimum or maximum values."],["If the input is valid, the method returns the validated number; otherwise, it returns null."]]],["The `doClassValidation_` method, part of the `FieldNumber` class, validates an input value to ensure it's a valid number. It accepts an optional `newValue` of any type as input. The method's core action is to check if the input fulfills the field's constraints. It returns a valid number if the input is valid; otherwise, it returns `null`, indicating the input is invalid.\n"]]