traverse firebase list (previous and next sibling) - angularjs

Is it possible to get the next child in a firebase list? I'm using the 'push()' functionality for lists. When I remove one item from the list I want to select the adjacent element so that there is always an item selected. But there is no way to get the sibling item.

Related

Devextreme list doesn't retain selected item

I have a simple react app with 2 components. On the left, there's a devExtreme list and on the right, there's a 'detail' pane. When I click an item in the list, I set a 'selectedItem' variable which is used by the right pane to show detail about this item. Now react rerenders - as it should - every time I change this variable (every time I click an item in the list). Now the list itself gets rerendered too so I lose the selection in the list. How should I tackle this problem? Thx
you can find the code here:

What is the best way to handle excluding items from a list via a user search?

Say I have a list of items and a user can search through the list. The list will at most be about 100 items all the data exists at run time so when searching no ajax request need to be made to get new list items, I just have to filter all existing items for the search term.
Is it better for performance if I just add class that hides the list items that don't match the search, or would it be better in the render method to only render the items that match the search. Assuming there is no search initially and all items are rendered on mount, wouldn't removing items because they don't match the users search term after mount be more costly than just adding a class to hide these items?
There are click handlers on the items in case it matters.
As the list will only be at most 100 items I would prefer to just hide them via a class but am not sure if this is really the react way to do it.
I would go with re-rendering the result list to only display the matching items in the list.
Hiding the non matching results has several drawbacks:
a bloated html with up to 100% items in display: none in case the search has no results...
it is probably more costly because you're re-rendering the html in order to apply the css class to hide the items
React is clever when it comes to updating the dom, so it's not really "react way" to tell him which items to hide. Just send the new list of items with the propre keys for each one.

Show only items in ng-repeat, when they are not in an other ng-repeat

I have a AngularJS problem and don't know how to deal with it. I have 2 ng-repeat lists, which contain the same objects.
The first list is showing "all" items. The second one should contain only some specific items. So now, i would filter the first list by the second one, to show the items only in one list.
So now, is there an option to filter List 1 by List 2?? The items are objects like
{'id':1, 'name':'test', 'alias':'test'}
Is there a simple way to realize this filter?

Treepanel losing selection after appending nodes. (ExtJS / Rally)

I am creating a treepanel object in Ext JS which dynamically adds nodes to the tree based on child information returned from the server. The problem I'm having is that I would like to be able to select multiple objects from the tree and have that selection remain after expanding a node. Since appending nodes is effectively changing the tree, the selection is lost. Is there any way I can preserve this selection after appending the new nodes?
you could save the nodes or ids of the nodes being selected and then reselect them after appending additional nods.

How to update array list using textbox

I made a list of arrays using JSON and display it as links. Now, I have textboxes below the lists where the array list item would appear if it was clicked. How would I update the value of the array list item if I changed it on the textbox and clicked on save so that even if the page is refreshed, the new data should appear on the list instead of the old one.
By the way, the codes for the array, displaying the array, the textboxes and buttons are all in the same html page.
To start with, you can use JSON.stringify on the array object and put it in the text box. After manual editing, apply it to the array using JSON.parse.

Resources