Firebase Realtime Database onChildChanged in subelements [duplicate]
This question already has an answer here:
How to tell which descendants are changed with on(“child_changed”)
2 answers
Here is the configuration of my database
I'd like to use onChildChanged to look on each date child (and not on each date). Actually, with onChildChanged, it trigger when there is a modification in a date, and I must loop on every child of the date. Is there any other way?
In other words, instead of looking on each child of request, I'd like to watch each child of each child of request.
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String prevChildKey)
for (DataSnapshot dayRequest: dataSnapshot.getChildren())
// do stuff
android firebase firebase-realtime-database
marked as duplicate by Frank van Puffelen
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 13 '18 at 14:43
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How to tell which descendants are changed with on(“child_changed”)
2 answers
Here is the configuration of my database
I'd like to use onChildChanged to look on each date child (and not on each date). Actually, with onChildChanged, it trigger when there is a modification in a date, and I must loop on every child of the date. Is there any other way?
In other words, instead of looking on each child of request, I'd like to watch each child of each child of request.
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String prevChildKey)
for (DataSnapshot dayRequest: dataSnapshot.getChildren())
// do stuff
android firebase firebase-realtime-database
marked as duplicate by Frank van Puffelen
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 13 '18 at 14:43
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How to tell which descendants are changed with on(“child_changed”)
2 answers
Here is the configuration of my database
I'd like to use onChildChanged to look on each date child (and not on each date). Actually, with onChildChanged, it trigger when there is a modification in a date, and I must loop on every child of the date. Is there any other way?
In other words, instead of looking on each child of request, I'd like to watch each child of each child of request.
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String prevChildKey)
for (DataSnapshot dayRequest: dataSnapshot.getChildren())
// do stuff
android firebase firebase-realtime-database
This question already has an answer here:
How to tell which descendants are changed with on(“child_changed”)
2 answers
Here is the configuration of my database
I'd like to use onChildChanged to look on each date child (and not on each date). Actually, with onChildChanged, it trigger when there is a modification in a date, and I must loop on every child of the date. Is there any other way?
In other words, instead of looking on each child of request, I'd like to watch each child of each child of request.
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String prevChildKey)
for (DataSnapshot dayRequest: dataSnapshot.getChildren())
// do stuff
This question already has an answer here:
How to tell which descendants are changed with on(“child_changed”)
2 answers
android firebase firebase-realtime-database
android firebase firebase-realtime-database
edited Nov 13 '18 at 13:59
KENdi
5,7992821
5,7992821
asked Nov 13 '18 at 11:48
A. CADERA. CADER
33
33
marked as duplicate by Frank van Puffelen
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 13 '18 at 14:43
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Frank van Puffelen
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 13 '18 at 14:43
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Firebase Realtime Database onChild*
events work on a list of child nodes.
If you attach a listener to Requests
it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot
of a date (the immediate child nodes).
There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.
Also see:
- How to tell which descendants are changed with on("child_changed")
- What is the correct way to listen to nested changes using Firebase?
- how to watch for sub-child added event in firebase
- How can I observe Firebase child value changes in multiple nodes in Swift?
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Firebase Realtime Database onChild*
events work on a list of child nodes.
If you attach a listener to Requests
it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot
of a date (the immediate child nodes).
There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.
Also see:
- How to tell which descendants are changed with on("child_changed")
- What is the correct way to listen to nested changes using Firebase?
- how to watch for sub-child added event in firebase
- How can I observe Firebase child value changes in multiple nodes in Swift?
add a comment |
Firebase Realtime Database onChild*
events work on a list of child nodes.
If you attach a listener to Requests
it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot
of a date (the immediate child nodes).
There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.
Also see:
- How to tell which descendants are changed with on("child_changed")
- What is the correct way to listen to nested changes using Firebase?
- how to watch for sub-child added event in firebase
- How can I observe Firebase child value changes in multiple nodes in Swift?
add a comment |
Firebase Realtime Database onChild*
events work on a list of child nodes.
If you attach a listener to Requests
it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot
of a date (the immediate child nodes).
There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.
Also see:
- How to tell which descendants are changed with on("child_changed")
- What is the correct way to listen to nested changes using Firebase?
- how to watch for sub-child added event in firebase
- How can I observe Firebase child value changes in multiple nodes in Swift?
Firebase Realtime Database onChild*
events work on a list of child nodes.
If you attach a listener to Requests
it will detect changes in the grandchildren that you have, but the event will fire with a DataSnapshot
of a date (the immediate child nodes).
There is no way to use them to fire changes on the grandchild level. You will either have to figure out what grandchild has changed yourself, set up a listener on each date, or store the grandchildren in a single flat list and attach the listener there.
Also see:
- How to tell which descendants are changed with on("child_changed")
- What is the correct way to listen to nested changes using Firebase?
- how to watch for sub-child added event in firebase
- How can I observe Firebase child value changes in multiple nodes in Swift?
answered Nov 13 '18 at 14:41
Frank van PuffelenFrank van Puffelen
235k29381407
235k29381407
add a comment |
add a comment |