How to hide a CQ component dynamically using Extjs? - extjs

I need to hide a CQ component from the page, when I select a particular value from another components dialog. Is this possible using ExtJS?

Yes, it is possible, but without more info it is difficult to give more details. In general, you can look up the xtypes you are using in your dialog at http://dev.day.com/docs/en/cq/current/widgets-api/index.html. Find the events that are available for the xtypes you are using in the dialog, then add a listener for one of the events exposed by that xtype. That allows you to run your own JavaScript code in response to an event--and that code could do things like hide HTML DOM elements.
Here is an example of using a listener to add custom functionality in response to an event: http://cq.shishank.info/2011/12/20/adding-limit-to-multifiled/
And here is another example: CQ5 - Hiding a tab within a component dialog depending on user group?

Related

Stylizing LWC radio list?

So right now I'm trying to build this radio list for the regions in LWC, the functionality works fine in that when you click on the regions it selects all the states below for that region.
https://i.stack.imgur.com/y2MM8.png
However, I want to stylize it so that it looks more proper. I'm a little confused how to do this using these components that LWC provides. Here's a mockup of what the regions should look like.
https://i.stack.imgur.com/A26PH.png
Here's what the HTML for it looks like.
https://i.stack.imgur.com/1vWcy.png
You can probably achieve this by using the grid system : https://www.lightningdesignsystem.com/utilities/grid/
We can achieve the same style by following a couple of steps:
Pass class to each lightning inputs to scope the styling.
Style radio controls having the passed class name.
save the file as .css and store in static resources.
Load style sheet in component by making use of loadStyle method from platformResourceLoader module.

Expanding and calling backend Service in UI-Grid

I have a UI Grid configured for my site. I have used expandableRowTemplate to expand it to show some simple content when user clicks on the expand button. Right now it shows the content properly.
But my requirement is when user user clicks on the expand button apart from expanding and showing the content it should also call a backend service to send some data to server and receive something.
Is this scenario possible in UI Grid? I am using Angular 1.5 and Ui Grid 4.0.1.
There's public API event which is fired when a row is toggled.
You can provide a function calling the REST service to this event.
gridApi.expandable.on.rowExpandedStateChanged(scope,function(row){})
And if you want to make a call only if the row is expanded, I see only 2 ways:
Either you have your own one redundant key to each row as row.isExpanded and toggle it inside this function and use for your purpose.
Or you can find if row inside this function is included in getExpandedRows()'s result. This is hilariously redundant.
Source: http://ui-grid.info/docs/#/api/ui.grid.expandable.api:PublicApi

Google Maps Android API v2 - InfoWindow with clickable buttons

I'm trying to put multiple buttons inside an GoogleMaps InfoWindos.
I know that: "Info window is not a live View, rather the view is rendered as an image onto the map. As a result, any listeners you set on the view are disregarded and you cannot distinguish between click events on various parts of the view. You are advised not to place interactive components — such as buttons, checkboxes, or text inputs — within your custom info window."
Soo I'm looking for an alternative.
Thanks for your help.
impliment the infowindowcliclistner.

Normal links with ExtJS callbacks?

In a renderer I'm generating links, which I want to map to my controllers functions.
The ActionColumn does this with images somehow, but I don't get the mechanism behind it.
I would like to have buttons there, but ExtJS only lets me render strings in a grid.
Well.. the question is bit confused.
If you want to implement an ActionColumn with a callback, you will only have to implement the "handler" property which is the callback. See in http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.column.Action
Real buttons aren't possible out of the box (and note: you should not), but you can render a button on your own.
I would suggest a bunch of icons (with the ActionColumn). No buttons required.

Referencing current dialog in ExtJS from a CQ5 component dialog

I'm new to CQ5 and ExtJS and this is my scenario:
I created a new component with its own dialog for authoring. In the dialog I added a checkbox field with a custom xtype that I created. What I want to do is this:
Whenever the checkbox is checked/unchecked, I want to dynamically add/remove a TAB to the existing dialog to show further authoring options.
I've seen how to handle ExtJS' Window and TabPanel but I can't figure out how to get the reference of the dialog I'm in so that I can manipulate it (add/remove tabs).
I tried CQ.Ext.WindowMgr.getActive() to see if that gets me my window/dialog but it's not giving me what I expect.
Any ideas? Thanks!
You probably want to add listener(s) to your field.
http://dev.day.com/docs/en/cq/current/developing/widgets.html#Dynamic Dialogs
You should be able to use this.findParentByType to find the parent dialog.

Resources