रिसर्च सर्वे: Blockly के साथ अपने अनुभव के बारे में हमें बताएं
सर्वे शुरू करें
क्रम से लगाए जा सकने वाले लेबल फ़ील्ड
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
सीरियलाइज़ किए जा सकने वाले लेबल, सामान्य लेबल के जैसे ही काम करते हैं. हालांकि, ये एक्सएमएल में भी सीरियलाइज़ किए जा सकते हैं. इनका इस्तेमाल सिर्फ़ तब किया जाना चाहिए, जब किसी लेबल के कॉन्टेंट में प्रोग्राम के हिसाब से बदलाव किया जा रहा हो और आपको उसे एक्सएमएल में सीरियलाइज़ करना हो.
क्रम से लगाया जा सकने वाला लेबल फ़ील्ड

छोटा किया गया ब्लॉक, जिसमें सीरीयलाइज़ किया जा सकने वाला लेबल फ़ील्ड है

शॉर्ट वीडियो
JSON
{
"type": "example_serializable_label",
"message0": "%1",
"args0": [
{
"type": "field_label_serializable",
"name": "FIELDNAME",
"text": "a serializable label"
}
]
}
JavaScript
Blockly.Blocks['example_serializable_label'] = {
init: function() {
this.appendDummyInput()
.appendField(new Blockly.FieldLabelSerializable("a serializable label"), "FIELDNAME");
}
};
सीरियलाइज़ किए जा सकने वाले लेबल फ़ील्ड में वैल्यू और वैकल्पिक css
क्लास स्ट्रिंग डाली जा सकती है. दोनों डिफ़ॉल्ट रूप से खाली स्ट्रिंग होती हैं.
एपिसोड क्रम से लगाने की सेटिंग
JSON
सीरियलाइज़ किए जा सकने वाले लेबल फ़ील्ड का JSON इस तरह दिखता है:
{
"fields": {
"FIELDNAME": text
}
}
यहां FIELDNAME
, सीरियलाइज़ किए जा सकने वाले लेबल फ़ील्ड का रेफ़रंस देने वाली स्ट्रिंग है और वैल्यू, फ़ील्ड पर लागू की जाने वाली वैल्यू है. वैल्यू, कॉन्स्ट्रक्टर वैल्यू के जैसे ही नियमों का पालन करती है.
XML
सीरियलाइज़ किए जा सकने वाले लेबल फ़ील्ड का एक्सएमएल ऐसा दिखता है:
<field name="FIELDNAME">text</field>
field
नोड के name
एट्रिब्यूट में, सीरियलाइज़ किए जा सकने वाले लेबल फ़ील्ड का रेफ़रंस देने वाली स्ट्रिंग होती है. साथ ही, नोड का इनर टेक्स्ट, फ़ील्ड पर लागू की जाने वाली वैल्यू होती है.
वैलिडेटर (पुष्टि करने वाले प्रोग्राम)
सीरीयलाइज़ किए जा सकने वाले लेबल फ़ील्ड में, पुष्टि करने वाले टूल काम नहीं करते. इसकी वजह यह है कि उपयोगकर्ता इनमें बदलाव नहीं कर सकता.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eSerializable labels function identically to regular labels but with the added capability of serializing to XML for programmatic content editing.\u003c/p\u003e\n"],["\u003cp\u003eThese labels are defined using JSON or JavaScript, specifying their type, message, arguments, and field name.\u003c/p\u003e\n"],["\u003cp\u003eSerialization of serializable labels is achieved through JSON or XML, representing the field name and its corresponding text value.\u003c/p\u003e\n"],["\u003cp\u003eUnlike regular labels, serializable labels lack validator support due to their non-editable nature.\u003c/p\u003e\n"]]],[],null,["# Serializable label fields\n\nSerializable labels work exactly the same as [normal labels](/blockly/guides/create-custom-blocks/fields/built-in-fields/label)\nexcept they also serialize to XML. They should only be used if you are editing\nthe content of a label programmatically, and wish it to serialize to XML.\n\n#### Serializable label field\n\n#### Serializable label field on a collapsed block\n\nCreation\n--------\n\n### JSON\n\n {\n \"type\": \"example_serializable_label\",\n \"message0\": \"%1\",\n \"args0\": [\n {\n \"type\": \"field_label_serializable\",\n \"name\": \"FIELDNAME\",\n \"text\": \"a serializable label\"\n }\n ]\n }\n\n### JavaScript\n\n Blockly.Blocks['example_serializable_label'] = {\n init: function() {\n this.appendDummyInput()\n .appendField(new Blockly.FieldLabelSerializable(\"a serializable label\"), \"FIELDNAME\");\n }\n };\n\nThe serializable label field takes in an optional value, and an optional css\nclass string. Both default to an empty string.\n\nSerialization\n-------------\n\n### JSON\n\nThe JSON for a serializable label field looks like so: \n\n {\n \"fields\": {\n \"FIELDNAME\": text\n }\n }\n\nWhere `FIELDNAME` is a string referencing a serializable label field, and\nthe value is the value to apply to the field. The value\nfollows the same rules as the constructor value.\n\n### XML\n\nThe XML for a serializable label field looks like so: \n\n \u003cfield name=\"FIELDNAME\"\u003etext\u003c/field\u003e\n\nThe `field` node's `name` attribute contains a string referencing a serializable\nlabel field, and the node's inner text is the value to apply to the field.\n\nValidators\n----------\n\nSerializable label fields do not support validators, because they are not\neditable by a user."]]