SAC scripting for Comment Widget

SAC scripting for Comment Widget

Pause comment widget

CommentWidget_1.setVisible(false);
Application.showBusyIndicator("Loading data...");

//do your code here...

CommentWidget_1.setVisible(true);
Application.hideBusyIndicator();

यह step-by-step इस प्रकार काम करता है:

CommentWidget_1.setVisible(false); — यह line temporary रूप से comment widget को users interface से छिपा देती है। यह सुनिश्चित करती है कि नया data load या process होने के दौरान users को अधूरा या पुराना data न दिखाई दे।

Application.showBusyIndicator("Loading data..."); — पूरे application में एक busy indicator (घूमता हुआ icon) के साथ "Loading data..." message display करता है, जो users को सूचित करता है कि कोई background operation चल रहा है। यह data refresh या script execution के दौरान feedback प्रदान करके users अनुभव को बेहतर बनाता है।

//do your code here... — यह placeholder main task या script logic को दर्शाता है, जैसे data प्राप्त करना, filter लगाना, या widget refresh करना।

CommentWidget_1.setVisible(true); — data load या processing पूरी होने के बाद, comment widget फिर से दिखाई देने लगता है।

Application.hideBusyIndicator(); — अंत में, busy indicator छिप जाता है, जो संकेत देता है कि कार्य सफलतापूर्वक पूरा हो गया है।

यह approach SAC applications में smooth, professional और user-friendly interactivity सुनिश्चित करता है।


Apply filter

CommentWidget_1.getCommentingDataSource().setDimensionFilter("Period","05");

SAP Analytics Cloud (SAC) Analytic Applications में किसी specific dimension value के आधार पर comments को filter करने के लिए इसका उपयोग किया जाता है। यहाँ, getCommentingDataSource(), CommentWidget_1 से जुड़े data source तक पहुँचता है, और setDimensionFilter("Period", "05") एक filter लागू करता है ताकि केवल Period = "05" से संबंधित comments ही प्रदर्शित हों। यह users के selections, time periods या data context के अनुसार कौन सी comments दिखाई दें, इसे dynamic रूप से नियंत्रित करने में मदद करता है। Relevant users  feedback या collaboration notes दिखाने के लिए interactive dashboards में months, quarters या fiscal periods के अनुसार discussions को filter करते समय इसका आमतौर पर उपयोग किया जाता है।


Remove filter

CommentWidget_1.getCommentingDataSource().removeDimensionFilter("Period");

SAP Analytics Cloud (SAC) Analytic Applications में, comment widget के data source से **remove an existing dimension filter** के लिए इसका उपयोग किया जाता है। यहाँ, getCommentingDataSource(), CommentWidget_1 से जुड़े data source तक पहुँचता है, और removeDimensionFilter("Period"), “Period” dimension पर लागू किसी भी filter को साफ़ करता है। इसका अर्थ है कि विभिन्न time period से संबंधित सभी comments किसी specific time period तक सीमित रहने के बजाय visible हो जाएँगी। यह filter reset करते समय, सभी उपलब्ध comments दिखाते समय, या dashboard में refreshed या dynamic selection context के लिए widget तैयार करते समय विशेष रूप से उपयोगी होता है।


Get layout

var TL=CommentWidget_1.getLayout();
console.log(TL);
var getT=CommentWidget_1.getLayout().getTop().value;
console.log("Top: " + getT);
var getB=CommentWidget_1.getLayout().getBottom().value;
console.log("Bottom: " + getB);
var getL=CommentWidget_1.getLayout().getLeft().value;
console.log("Left: " + getL);
var getR=CommentWidget_1.getLayout().getRight().value;
console.log("Right: " + getR);
var getH=CommentWidget_1.getLayout().getHeight().value;
console.log("Height: " + getH);
var getW=CommentWidget_1.getLayout().getWidth().value;
console.log("Width: " + getW);

var TL = CommentWidget_1.getLayout();
CommentWidget_1 का layout object store करता है, जो application के भीतर widget की स्थिति और आकार को नियंत्रित करता है।
console.log(TL);
Layout-related properties के निरीक्षण और debugging के लिए browser console में संपूर्ण layout object print करता है।

var getT = CommentWidget_1.getLayout().getTop().value;
Comment widget की top position (pixels में) प्राप्त करता है और उसे getT variable में store करता है।
console.log("Top: " + getT);
console में getT का value log करता है, debugging उद्देश्यों के लिए widget की top position दिखाता है।

var getB = CommentWidget_1.getLayout().getBottom().value;
Comment widget की bottom position का value प्राप्त करता है और उसे getB variable को assign करता है।
console.log("Bottom: " + getB);
Verification के लिए console में comment widget की bottom layout position show करता है।

var getL = CommentWidget_1.getLayout().getLeft().value;
Widget के left margin value को प्राप्त करता है और बाद में use या display के लिए उसे getL variable में store करता है।
console.log("Left: " + getL);
Widget की वर्तमान left position दिखाने के लिए console में getL value print करता है।

var getR = CommentWidget_1.getLayout().getRight().value;
Layout configuration से comment widget की right position value को getR में retrieve और store करता है।
console.log("Right: " + getR);
Debugging के लिए browser console में comment widget की right layout position value को log करता है।

var getH = CommentWidget_1.getLayout().getHeight().value;
Comment widget की height (pixels में) प्राप्त करता है और उसे getH variable में store करता है।
console.log("Height: " + getH);
Console में comment widget की height का value प्रदर्शित करता है ताकि उसके vertical dimension की पुष्टि की जा सके।

var getW = CommentWidget_1.getLayout().getWidth().value;
Pixels में comment widget की width प्राप्त करता है और उसे getW variable में store करता है।
console.log("Width: " + getW);
Console में widget की width का value print करता है, जिससे उसकी horizontal dimension setting की पुष्टि होती है।


Set layout

CommentWidget_1.getLayout().setTop(100);
CommentWidget_1.getLayout().setBottom(100);
CommentWidget_1.getLayout().setLeft(100);
CommentWidget_1.getLayout().setRight(100);
CommentWidget_1.getLayout().setHeight(500);
CommentWidget_1.getLayout().setWidth(500);

CommentWidget_1.getLayout().setTop(100);
Application layout के top edge से 100 pixels पर comment widget की top position निर्धारित करता है।

CommentWidget_1.getLayout().setBottom(100);
Application layout की bottom boundary से 100 pixels ऊपर comment widget की bottom position निर्धारित करता है।

CommentWidget_1.getLayout().setLeft(100);
Application layout क्षेत्र के बाईं ओर से 100 pixels दूर comment widget की position निर्धारित करता है।

CommentWidget_1.getLayout().setRight(100);
Application layout क्षेत्र के दाईं ओर से 100 pixels दूर comment widget की position निर्धारित करता है।

CommentWidget_1.getLayout().setHeight(500);
comment widget की ऊँचाई 500 pixels निर्धारित करता है, जो application canvas पर इसके vertical आकार को नियंत्रित करता है।

CommentWidget_1.getLayout().setWidth(500);
comment widget की चौड़ाई 500 pixels निर्धारित करता है, जो application layout में इसके horizontal आकार को नियंत्रित करता है।


Get CSS class

CommentWidget_1.getCssClass();

SAP Analytics Cloud (SAC) Analytics Applications में, getCssClass() function का उपयोग किसी widget पर वर्तमान में लागू CSS class नाम (नामों) को प्राप्त करने के लिए किया जाता है — इस मामले में, CommentWidget_1। लौटाया गया value एक string है जो widget को assigned एक या अधिक CSS classes का represent करता है। Developers इस function का उपयोग widget की styling की जाँच या verify के लिए करते हैं, खासकर जब dynamic visual changes को scripting के माध्यम से नियंत्रित किया जाता है। वर्तमान CSS class को जानकर, आप addCssClass() या removeCssClass() का उपयोग करके conditional styling adjustment कर सकते हैं ताकि comment widget के स्वरूप या व्यवहार को dynamic रूप से बेहतर बनाया जा सके।


Set CSS class

CommentWidget_1.setCssClass("my-normal-class");

SAP Analytics Cloud (SAC) Analytic Applications में किसी widget पर एक specific CSS class लागू करने के लिए उपयोग किया जाता है, इस मामले में, CommentWidget_1। setCssClass() function widget पर मौजूद किसी भी मौजूदा CSS class को parentheses में दिए गए नए class से बदल देता है — "my-normal-class"। इससे developers widget के appearance को dynamic रूप से नियंत्रित कर सकते हैं, जैसे कि predefined CSS नियमों के माध्यम से background का रंग, font style या border बदलना। यह विशेष रूप से comments को highlight करने, theme बदलने, या states (जैसे active या inactive) को visual रूप से दर्शाने के लिए उपयोगी है। Apply की गई class को application की CSS settings में पहले से defined किया जाना चाहिए।


Check if comment widget is visible or not

var chk=CommentWidget_1.isVisible();
console.log(chk);

SAP Analytics Cloud (SAC) Analytics Applications में इसका उपयोग यह जाँचने के लिए किया जाता है कि कोई widget वर्तमान में page पर दिखाई दे रहा है या नहीं। isVisible() function एक Boolean value लौटाता है - यदि widget (यहाँ, CommentWidget_1) दिखाई दे रहा है तो true और यदि hidden हुआ है तो false। यह value chk variable में stored होता है। console.log(chk); statement फिर browser के console में परिणाम print करता है, जिससे developers को visibility-related logic को debug करने में मदद मिलती है। यह function user interactions, filters या conditional application states के आधार पर widget को dynamic रूप से दिखाने या छिपाने के लिए उपयोगी होता है।

एक टिप्पणी भेजें

Please do not enter any spam link in the comment box.

और नया पुराने