How to show a selected record in the visible portion of a tree - extjs

I have a tree control in a fieldset. Am able to populate the tree fine.
I'm using this command to programmatically select a specific node in the tree:
Ext.getCmp('projectsTree').getSelectable().setSelectedRecord(<node>)
where node is the node I want to select. This command works fine. What's happening is that while the record is selected, it is not in the visible portion of the tree. It can be below the visible portion of the tree and I would have to scroll down to see that it is selected. Does anyone have any tips on how to both select the record and have it show up in the visible portion of the tree.
I've seen recommendations using focusRow or selectPath, but I haven't been able to get that working.

Related

React DnD make dropTargets when hover on something while dragging item

I'm trying to do something like below:
Scenario 1: User will drag and drop List 1 from left side to right side.
Scenario 2: Again, User will drag list 2 to right side, when that dragging item hover on list 1, have to show drop zones to drop that list 2 item here.
Finally, List 1 and List 2 both will be placed like left and right side.
With React Dnd, Is this achievable? and I tried this it works only while dragging. https://stackblitz.com/edit/react-pctpdh
I'm able to show a drop area while dragging, it shows every time, but I need to show that drop area only hover on some item.
Below is the sample work, I have to achieve:
Need to show placeholder to drop an item while hover other items to drop. (Need to Create dynamic drop targets while mouse hover some item)
I need a help on this to achieve this feature.Any idea on this really commendable.
I saw the code snippet and i added some new code that replicates your desired behavior.
The idea is to create a separate component to handle drop actions, that can be reused when is needed. In this particular case, I choose to use the component inside your ListItem component to create two drop zones on both sides.
Here is the updated code: https://stackblitz.com/edit/react-pctpdh

ADF tree binding issue

I'm using 3 levels tree VO's. All three VO's has bind variables. The VO's are connected via View link. I'm using createViewLinkAccessorRS in order to pass the variables from parent to child VO.. i defined Target Data Source (EL_expression) for second and third level.The tree works fine, and the nodes filled correctly (all the way down). The Problem is that the second and the third tree level attributes are only shown in the tree component. anywhere else in the page it looks like they are empty ({bindings.(attname).inputValue} = null) (E.g - after dragging the third tree level "FlowOrder" from the AppModuleDataControl and create a form out of it, and selecting the second node of the tree will update all the third level tree node (please see attached image), but will leave the entire form which was just created empty)
Any idea why the FlowOrder bindings are empty? i assume that maybe it has to do with the bind variable of the VO .. i even thought i would change the tree selection listener so on the second level click it will perform a full query of "FlowOrder" via executewithparams, but it does not make any sense because the data was fetched already after clicking level 2 tree)
(Jdeveloper : 12.2.1.2.0)
attached image: Details
Check out my explanation on trees and example application in another post: ADF filter table based on tree selection The tree shows data from view link accessors. The form shows data from view instance. They are in different state.

Angularjs - Store data to ng-model dynamically on drag drop within popup

I am working on drag drop functionality where one can drag node from list A(source) and drop to list B(destination).
I am facing problem of when once dragged and dropped first node and opens model on-click, I have to set some question within ng-repeat.
But when i am dropping same type of question, then values set to previous one is remains to newly dropped question's model.
How i can avoid such a problem?
I am using this ui-tree example for drag and drop.
Following image is snapshot of it?
https://i.stack.imgur.com/jIJsQ.png][2]
Please share your opinion!

In ExtJS 4, How do you delete a tree node when the associated grid information to the node is deleted at random

My code so far populates via drag and drop tree nodes and leaves from a grid panel. I want to know how to remove a tree node when the grid information associated with it is removed.
You should have something like id property in your model both in grid and tree. So when you remove record in the grid you then search for the node with this id in tree and remove it as well. Another way is just save the reference to the node when you drop it.
The flow is:
user drags and drops record from grid to the tree
when the record is dropped and new node is created you save reference in the grid's record
onNodeDrop: function(){
grid.getSelected().treeNode = tree.lastCreatedNode;
}
then when you delete record in grid you could delete node as well.
Note - this is just a psuedocode, is won't work. Just to give you an idea.

Opening tab with tree node data

Hi,
I'm new to both Prism and WPF, and I have a question regarding sharing data between views.
Application I'm working on resembles SQL Server Development Studio. Demo contains two regions. First region contains tree (like Object explorer in SQL Server DS). Tree nodes are bound to different view models. Example would be DatabaseA->Tables->dbo.TableA->Columns etc.
Second region is initially empty. When I double click on tree node I would like to open view that displays data I clicked in tree.
In detail:
1. double click on tree node
2. node data and display it in second region
3. if second region isn't empty, check if clicked node data is already displayed in one of existing tab pages
4. if not, create new tab page with clicked node data, otherwise focus existing tab page
Until now, I managed to created tree. When tree node is clicked app calls:
UriQuery uriQuery = new UriQuery {{"ID", unit.Id.ToString()}};
uriQuery.Add("TypeName", "Unit");
var uri = new Uri("DebugTreeItemView" + uriQuery, UriKind.Relative);
RegionManager.RequestNavigate("SECOND_REGION", uri);
This will open view with tab control and I can fetch uri parameters. But I'm not satisfied with this solution. I need a way to:
1. intercept this RegionManager.RequestNavigate call in order to check if tab control is alread created. Also, I need to check that clicked node data isn't already displayed in one of existing tab pages.
2. I would like to send Unit object directly to tab control view instead of sending ID and typename. What is the best way to achieve this?
Thanks.
I would have a ShellViewModel controlling my overall application. It would contain the TreeNode collection for the left side, and the OpenTabs collection for the right side. It would also contain the SelectedTabIndex for the right side, and perhaps the SelectedTreeNode for the left side if it made sense to do so.
When you want to open a new Tab, I would use the EventAggregator to publish an OpenTab event and pass it the selected TreeNode item. The ShellViewModel would subscribe to those events, and would determine if that object already existed in the OpenTabs collection. If it exists, it simply sets the SelectedTabIndex. If not, it adds the item to the OpenTabs collection before setting the SelectedTabIndex
A while back I posted something here on this sort of navigation with MVVM if you're interested

Resources