You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this enhancement is not addressed yet, may I know when you guys are going to address this parent node, because lot of people are looking this kind of functionality.
@muralinit
I've solved this with objects/arrays but not with simple datatypes such as string, number, boolean, etc.
So, if the found item is not simple type, the "parentNode" property can be accessed. Since, I only have half the solution, I've chosen to wait with the implementation.
Well good I am using objects in my current project, so for the current situation I can use your temporary solution. One more idea is you can publish the solution and open a new issue for addressing the issue on Simple types. In my opinion most of the people will use Objects so at least there will be relief. So please give me your changes. If they are in the current check-in I will take it from there.
Enabling features such as;
var found = JSON.search( data, '//item' );
found[0].nodename
// item
found[0].parentNode
// the parent object to the found item
found[0].search('./*[id=1]');
// searches only among children of found item
The text was updated successfully, but these errors were encountered: