با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
blockly > Block > getParent
متد ()block.getParent
اگر این بلوک در سطح بالایی است، بلوک والد یا تهی را برگردانید. بلوک والد یا بلوک متصل به اتصال قبلی (برای بلوک دستور) یا بلوک متصل به اتصال خروجی (برای بلوک مقدار) است.
امضا:
getParent(): this | null;
برمی گرداند:
این | تهی
بلوکی (در صورت وجود) که بلوک فعلی را نگه می دارد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[],["The `Block.getParent()` method retrieves the parent block of a given block. It returns either the parent block instance or `null` if the block is at the top level. The parent is determined by the block's connection: the previous connection for statement blocks or the output connection for value blocks. The method's signature indicates it returns either `this` (the parent block) or `null`.\n"]]