How to get DOM node in Ext.view.View by Record? - dom

I am using ExtJS 4.2.3 to create a small JavaScript application. In that application i have a Ext.view.View with a custom template to show the data.
On select/deselect i would like to animate a part of the item. At the moment i am using the select/deselect events of the Ext.view.View to trigger the animation. The problem is that this events only get a reference to the record that was selected/deselected. How can i get the matching DOM node within the Ext.view.View in order to trigger the animation?

Use Ext.view.View.getNode method to get the selected HTML Element, from selected Record object
Ext.view.View

Related

Creating a set of buttons with oncick events on them

I have an array of objects in my game, and I want to create buttons in the UI, based on object count in array. In menu construction script, array is scanned for objects, and for each of them button is created, and labeled by object name.
Now I want to do onclick event for these buttons which will display info about respective object in the UI. So I need to somehow create a onclick event for each of appearing buttons, or create universal onclick event for this group of buttons, which will read object name from button and search for that in the array. Is it possible to create events for objects which are going to appear during game? Please suggest.
Workaround - by onclick event get buttons array and find which is hovered by mouse ATM
you could make a widget object containig the button with the onclick event, then in the contruction script you create the widgets.
Here you can find some documentation for widgets:
https://docs.unrealengine.com/en-US/Engine/UMG/UserGuide/WidgetBlueprints/index.html
https://docs.unrealengine.com/en-US/Engine/UMG/UserGuide/CreatingWidgets/index.html

Common Event Listener for multiple instances of custom element

I am creating a dropdown-multi-select custom element.
When user clicks outside the dropdown, I would like to close the dropdown, therefore I am attaching an event listener to the window to detect outside-click.
My Problem is when multiple instance of this component is created, there will be multiple event listeners doing the same job.
I intend to put this component in every row of a table with 1000 rows
I would like to know
Is there a better way to do it.
Having 1000s of event listener, should I be concerned about it
Even if you have 1000s of drop-down custom element, only one is active at a given time.
Therefore you should attach on window the event listener for the active (and expended) drop-down list...
...and detach it when the drop-down list has collapsed.

Ag-grid event to identify changed rows/Values

I am trying to find out a solution to implement save functionality after the values in the ag-grid is changed.
I have an angular2 ag-grid with almost 100 columns but only 4 columns are editable. And on click of a save button on my web page i want to post only the changed values if any by the user, to the database. Is there any event which i can use to identify changed rows in the grid? Or any other suggestion to implement such scenario?
I looked at rowValueChanged and cellValueChanged event, but these event will trigger after every change? I need to get the values only after the user hits save button.

Auto complete a dropdown menu in a cq5 dialog based on input from a previous dialog field

My custom CQ5 component has a dialog which consists of 2 drop down menus. I would like to automatically set a default value to second menu depending on whatever is the value selected from the previous drop down.
How can I achieve this?
you can register handlers for different events triggered by the widgets. You can use the "selectionchanged" event to register a function that will read the new content from the dropdown and then use the setValue() method in the second dropdown to put whatever you want there.
To obtain the second dropdown from the first you can use the nextSibling() method.
The widget documentation will help you a lot. look for "selection"

Display Additional Form on Update - RadGrid

I'm using a RadGrid for changing record status's. Users have the ability to select a status from a dropdown and update that record with that status. Depending on the status chosen, when the user clicks update I want to popup an additional form so the user can fill out more data required for the update. I'm not sure the best way to go about implementing this. Any suggestions are appreciated.
One way is to use the RadWindow like a modal and pop it up to the user via client-side JavaScript. We use RadWindows in our applications and it works. Or, the RadWindow supports a Nested Grid or View that you can have as a record's child; so you can have the master record, click on the arrow on the left and expand the record to view a nested grid of data, or a custom view (via the NestedViewTemplate property). You can also have the form in a DIV, hide it, then show it via JavaScript too.
Those are two ways.
HTH.