Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial node reload #813

Closed
HASTJI opened this issue May 29, 2024 · 4 comments
Closed

Partial node reload #813

HASTJI opened this issue May 29, 2024 · 4 comments

Comments

@HASTJI
Copy link

HASTJI commented May 29, 2024

Hello. Is it possible to reload not all node tree, but only sub-node? I'm using "load_on_demand" option and want to reload sub-tree after, for example, I done something in another js function and want to reload sub-tree to update the list of the nodes from DB.

I already tried something like this:

var id = '123';
var node = $('#One').tree('getNodeById', id );
$('#One').tree('reload', node); 

Is it even possible?

@mbraak
Copy link
Owner

mbraak commented May 29, 2024

You can use loadDataFromUrl: loadDataFromUrl

This should work if you're using load on demand:

var id = '123';
var node = $('#One').tree('getNodeById', id);
$('#One').tree('loadDataFromUrl', node);

@HASTJI
Copy link
Author

HASTJI commented May 31, 2024

You can use loadDataFromUrl: loadDataFromUrl

This should work if you're using load on demand:

var id = '123';
var node = $('#One').tree('getNodeById', id);
$('#One').tree('loadDataFromUrl', node);

It works, thanks! Is that method make same thing that updateNode, but in different way? I mean in updateNode we call method and then put json-like data from ajax request(or any other json-ish type array) in it but in loadDataFromUrl we just reload it in auto mode from request. Are those methods quite a bit similar aren't they?

@mbraak
Copy link
Owner

mbraak commented Jun 1, 2024

Yes, they call the same internal methods.

@mbraak
Copy link
Owner

mbraak commented Jun 5, 2024

Closing the issue because the question was answered.

@mbraak mbraak closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants