I am trying to enable my control for DashboardView and ComponentView. In DashboardView view I can enable the control on selection of component which is working fine BUT if i open the component in ComponentView the control is not getting enabled. If some have the solution? Here is the code
Extensions.HW.prototype.isAvailable = function HW$isAvailable(selection, pipeline)
{
var items = selection.getItems();
var item = $models.getItem(selection.getItem(0));
if (items.length >= 1 && item.getItemType() == $const.ItemType.COMPONENT ) {
return true;
}
else {
return false;
}
};
Extensions.HW.prototype.isEnabled = function HW$isEnabled(selection, pipeline) {
var items = selection.getItems();
var item = $models.getItem(selection.getItem(0));
if (items.length >= 1 && item.getItemType() == $const.ItemType.COMPONENT ) {
return true;
}
else {
return false;
}
};
I am using two views in configuration as
<cfg:dependency>HelloWorldRibbon.Commands</cfg:dependency>
</ext:dependencies>
<ext:apply>
<ext:view name="DashboardView">
<ext:control id="DashboardToolbar" />
</ext:view>
<ext:view name="ComponentView">
<ext:control id="ItemToolbar" />
</ext:view>
</ext:apply>
</ext:extension>
Here is the screenshot on which control is disabled
I want to enable this control while component is opened.