मोडल बॉक्स को संभालना

मोडल बॉक्स को संभालना

इस पृष्ठ का अनुवाद AI उपकरणों का उपयोग करके किया गया है और इसमें त्रुटियाँ हो सकती हैं। सबसे सटीक और नवीनतम जानकारी के लिए, कृपया मूल अंग्रेजी संस्करण देखें।

invoke विधि से मोडल बॉक्स खोलना

निर्दिष्ट स्थान में एक्सटेंशन का एक नया iframe इंस्टेंस बनाता है।


zohoprojects.invoke("modal.create",modal_location);
आर्गुमेंट का नामडेटा टाइपविवरण
actionstring"modal.create" - एक मोडल बॉक्स बनाता है या खोलता है।
modal_locationObjectउस HTML फ़ाइल का सापेक्ष पथ जिसे invoke करना है। उदाहरण: {"url":"/app/choosefiles.html"};

आउटपुट के रूप में एक widget ID और एक string constant जेनरेट किया जाता है।

invoke विधि से मोडल बॉक्स बंद करना

एक्सटेंशन के iframe इंस्टेंस को बंद करता है जो निर्दिष्ट स्थान में पहले से खुला था।


zohoprojects.invoke("modal.close",modalInfo.widgetID);
आर्गुमेंट का नामडेटा टाइपविवरण
actionstring"modal.close" - खुले हुए मोडल बॉक्स को बंद करता है।
widgetIDObject"modal.create" के आउटपुट के रूप में जेनरेट किया गया widgetID यहाँ पास किया जाना चाहिए।

invoke विधि से मोडल बॉक्स को फिर से आकार देना

एक्सटेंशन के iframe इंस्टेंस को निर्दिष्ट आकार में फिर से आकार देता है।

zohoprojects.invoke("modal.resize", resize_modal);
आर्गुमेंट का नामडेटा टाइपविवरण
actionstring"modal.resize" - मोडल बॉक्स के डिफ़ॉल्ट आकार को बढ़ाता है।
resize_modalObjectउस HTML फ़ाइल का सापेक्ष पथ जिसे invoke करना है। उदाहरण:{"width" : 600,"height" : 400};
न्यूनतम और अधिकतम अनुमत ऊँचाई 380px और 450 px है।
न्यूनतम और अधिकतम अनुमत चौड़ाई 550px और 950 px है।

आउटपुट के रूप में एक widget ID और एक string constant जेनरेट किया जाता है।

invoke विधि से attachment picker को बंद करना

एक्सटेंशन के iframe इंस्टेंस को बंद करता है जो निर्दिष्ट स्थान में एक फ़ाइल संलग्न करने के लिए खुला था।


zohoprojects.invoke("attachment_picker.close");

instance

एक विशिष्ट widget के लिए एक instance बनाता है।



zohoprojects.instance(widget_ID);

आर्गुमेंट का नामडेटा टाइपविवरण
IDstringinvoke विधि से जेनरेट किया गया Widget ID।

emit

वर्तमान स्थान से डेटा को प्रेषित करता है।



zohoprojects.emit("KeyforMyListener", data);

on

emit विधि से डेटा को सुनता है या प्राप्त करता है।



zohoprojects.on("KeyforMyListener", data);

मान लीजिए कि निम्नलिखित नमूना कोड ब्लॉक एक पैरेंट फ़ाइल '/apps/index.html' से कॉल किया जाता है और '/apps/file.html' चाइल्ड फ़ाइल है।


var modal_location={"url":"/apps/file.html"};
zohoprojects.invoke("modal.create",modal_location).then(function(modalInfo){
var modalInstance=zohoprojects.instance(modalInfo.widgetID);
modalInstance.on("modal.opened", function(){ /* This code listens for the status 'modal.opened' from the child HTML - file.html */
var data = {org: "1234"};
modalInstance.emit("submit", data);
});/* This code throws a status 'submit' along with an object to the child HTML - file.html*/
modalInstance.on("submitted",function(data){ 
/*This code listens for a status with the key 'submitted' from the child HTML*/
zohoprojects.invoke("modal.close", modalInfo.widgetID);
});

मान लीजिए कि निम्नलिखित नमूना कोड ब्लॉक चाइल्ड फ़ाइल '/apps/file.html' से कॉल किया जाता है और '/apps/index.html' पैरेंट फ़ाइल है।



var filedetails = {"filename": "abc"};
zohoprojects.on("submit", function (data) {});
/*This code listens for an event with the key "submit" from the parent file index.html  */
zohoprojects.emit("submitted", filedetails); 
/* This code throws a status 'submitted' along with an object to the parent file index.html */

अलर्ट

सफलता या विफलता के अलर्ट सेट करें और प्रदर्शित करें।


zohoprojects.invoke("alert", {
                            type: "success",  //or "failure"
                            data: "Permission granted successfully"
                        });

ट्रांज़िशन पूर्ण करें

Task transition को पूर्ण के रूप में चिह्नित करें


zohoprojects.invoke("completeTaskTransition"); 

ट्रांज़िशन बंद करें

Task transition पॉप-अप को बंद करें


zohoprojects.invoke("closeTransition");