{"id":10857,"date":"2022-09-25T05:49:31","date_gmt":"2022-09-25T00:19:31","guid":{"rendered":"http:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/"},"modified":"2022-09-25T05:49:31","modified_gmt":"2022-09-25T00:19:31","slug":"solved-how-to-enable-the-button-which-is-created-using-custom-control","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/","title":{"rendered":"[Solved] How to enable the button which is created using custom control"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-11898168\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"11898168\" data-parentid=\"11897324\" data-score=\"5\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>As indicated by Jeremy&#8217;s answer, you don&#8217;t need the <code>ext:issmallbutton<\/code> to enable your button (you mention <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/tridiondeveloper.com\/ribbon-item-group\">my article<\/a> on Tridion Developer, where I specifically state that the <code>ext:issmallbutton<\/code> is not to be used when you want to stack buttons on top of eachother). <\/p>\n<p>You probably should try to debug your JavaScript and see what is happening in your <code>_isAvailable(selection, pipeline)<\/code> and <code>_isEnabled(selection, pipeline)<\/code> methods.<\/p>\n<p>The isAvailable method should indicate whether the command is applicable for the selected item(s) and the isEnabled method indicates whether the command can be executed. I usually just let the isEnabled method return the result of the isAvailable one (since when the button is available, it should most of the time also be enabled). An example of how to enable a button when you have selected a Page would look something like this:<\/p>\n<pre class=\"lang-js prettyprint-override\"><code>Example.PageBtn.prototype._isAvailable = function PageBtn$_isAvailable(selection, pipeline) {\n    if (pipeline) {\n        pipeline.stop = false;\n    }\n\n    if (selection.getCount() == 1) {\n        var itemType = $models.getItemType(selection.getItem(0));\n        return itemType &amp;&amp; (itemType == $const.ItemType.PAGE);\n    }\n    return false;\n};\nExample.PageBtn.prototype._isEnabled = function PageBtn$_isEnabled(selection, pipeline) {\n    if (pipeline) {\n        pipeline.stop = false;\n    }\n    return this._isAvailable(selection);\n}; \n<\/code><\/pre>\n<p>Now the <code>ext:issmallbutton<\/code> element has nothing to do with this all, but if you would like to know where that should be used exactly, it is supposed to go inside the <code>ext:extension<\/code>element like so:<\/p>\n<pre class=\"lang-xml prettyprint-override\"><code>&lt;ext:extension assignid=\"PageBtn\" groupid=\"MyGroup\" name=\"Example\" pageid=\"HomePage\"&gt;\n    &lt;ext:command&gt;PageBtn&lt;\/ext:command&gt;\n    &lt;ext:title&gt;Example&lt;\/ext:title&gt;\n    &lt;ext:issmallbutton&gt;true&lt;\/ext:issmallbutton&gt;\n    &lt;ext:dependencies&gt;\n        &lt;cfg:dependency&gt;Example.Commands&lt;\/cfg:dependency&gt;\n    &lt;\/ext:dependencies&gt;\n    &lt;ext:apply&gt;\n        &lt;ext:view name=\"DashboardView\"&gt;\n            &lt;ext:control id=\"DashboardToolbar\" \/&gt;\n        &lt;\/ext:view&gt;\n    &lt;\/ext:apply&gt;\n&lt;\/ext:extension&gt;\n<\/code><\/pre>\n<p>You can find more information in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.sdltridionworld.com\/articles\/sdltridion2011\/tutorials\/GUIextensionIn8steps.aspx\">Setting up a SDL Tridion 2011 GUI extension in 8 steps<\/a>.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">3<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved How to enable the button which is created using custom control <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] As indicated by Jeremy&#8217;s answer, you don&#8217;t need the ext:issmallbutton to enable your button (you mention my article on Tridion Developer, where I specifically state that the ext:issmallbutton is not to be used when you want to stack buttons on top of eachother). You probably should try to debug your JavaScript and see what &#8230; <a title=\"[Solved] How to enable the button which is created using custom control\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/\" aria-label=\"More on [Solved] How to enable the button which is created using custom control\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[1793,2980],"class_list":["post-10857","post","type-post","status-publish","format-standard","hentry","category-solved","tag-tridion","tag-tridion-2011"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[Solved] How to enable the button which is created using custom control - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] How to enable the button which is created using custom control - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] As indicated by Jeremy&#8217;s answer, you don&#8217;t need the ext:issmallbutton to enable your button (you mention my article on Tridion Developer, where I specifically state that the ext:issmallbutton is not to be used when you want to stack buttons on top of eachother). You probably should try to debug your JavaScript and see what ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-25T00:19:31+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-how-to-enable-the-button-which-is-created-using-custom-control\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-how-to-enable-the-button-which-is-created-using-custom-control\\\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] How to enable the button which is created using custom control\",\"datePublished\":\"2022-09-25T00:19:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-how-to-enable-the-button-which-is-created-using-custom-control\\\/\"},\"wordCount\":208,\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"keywords\":[\"tridion\",\"tridion-2011\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-how-to-enable-the-button-which-is-created-using-custom-control\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-how-to-enable-the-button-which-is-created-using-custom-control\\\/\",\"name\":\"[Solved] How to enable the button which is created using custom control - JassWeb\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\"},\"datePublished\":\"2022-09-25T00:19:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-how-to-enable-the-button-which-is-created-using-custom-control\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-how-to-enable-the-button-which-is-created-using-custom-control\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-how-to-enable-the-button-which-is-created-using-custom-control\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] How to enable the button which is created using custom control\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\\\/\\\/jassweb.com\"],\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/author\\\/jaspritsinghghumangmail-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] How to enable the button which is created using custom control - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] How to enable the button which is created using custom control - JassWeb","og_description":"[ad_1] As indicated by Jeremy&#8217;s answer, you don&#8217;t need the ext:issmallbutton to enable your button (you mention my article on Tridion Developer, where I specifically state that the ext:issmallbutton is not to be used when you want to stack buttons on top of eachother). You probably should try to debug your JavaScript and see what ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/","og_site_name":"JassWeb","article_published_time":"2022-09-25T00:19:31+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] How to enable the button which is created using custom control","datePublished":"2022-09-25T00:19:31+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/"},"wordCount":208,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["tridion","tridion-2011"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/","url":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/","name":"[Solved] How to enable the button which is created using custom control - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-09-25T00:19:31+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-how-to-enable-the-button-which-is-created-using-custom-control\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] How to enable the button which is created using custom control"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/10857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=10857"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/10857\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=10857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=10857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=10857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}