khan4019 / tree-grid-directive

Need one or more maintainer for this! comment or email me if you are interested
http://khan4019.github.io/tree-grid-directive/test/treeGrid.html
347 stars 183 forks source link

How to load dynamic tree from REST #14

Closed cwichoski closed 9 years ago

cwichoski commented 10 years ago

Hi,

appears that only work with fixed tree, how I can load the tree dynamically from REST? And update that tree with new REST requests?

Thanks for any help.

okigan commented 10 years ago

dont think this is supported -- i might need this as well, so may have to add it (watch my fork of this project)

khan4019 commented 10 years ago

sorry, i didnt get a chance to look into it. If you can add it, i will merge it

graywolf336 commented 10 years ago

I too am curious about this, since it is a feature I would need if I was to use this. I might play around with the code and see if I can get it, no promises though. :smile:

graywolf336 commented 10 years ago

I figured out how, but I also made a few more changes to my version of it. If you're interested in seeing how I did it you can take a look here: https://github.com/graywolf336/tree-grid-directive/commit/17c25162d34bfc8bce3084fccdfd888bad5e4b84

okigan commented 10 years ago

Nice, will check it out

On Aug 16, 2014, at 11:30 PM, graywolf336 notifications@github.com wrote:

I figured out how, but I also made a few more changes to my version of it. If you're interested in seeing how I did it you can take a look here: graywolf336@17c2516

— Reply to this email directly or view it on GitHub.

aidanlister commented 9 years ago

Oh dynamic data is really important and I can't get graywolf's version to work. Is someone able to update this?

kpnigalye commented 9 years ago

try using 'promise' feature by angular. That worked for me.

aidanlister commented 9 years ago

I got graywolf366's going. I also made an example on Plunkr, and showed how you can customise the template without changing the directive source: http://plnkr.co/edit/bxejGsjMg3MaqnYcHKze?p=preview

diosney commented 9 years ago

@aidanlister I' m trying to see your plnkr but for some reason its giving me trouble to acces it.

Please, can you post the sample code to other place so I can see it? It doesn't have to be a live site, just the code (pastebin or another one could work).

Thanks in advance.

aidanlister commented 9 years ago

There's too much code, the plunkr seems to work for me in incognito?

diosney commented 9 years ago

@aidanlister That was for no use :( It simple doesn't load for me.

Nevertheless, I did I understand now, is it loading the whole data at a later moment using promises, right?

aidanlister commented 9 years ago

Try a different browser or device then...

On Wednesday, 11 February 2015, Diosney Sarmiento notifications@github.com wrote:

@aidanlister https://github.com/aidanlister That was for no use :( It simple doesn't load for me.

Nevertheless, I did I understand now, is it loading the whole data at a later moment using promises, right?

— Reply to this email directly or view it on GitHub https://github.com/khan4019/tree-grid-directive/issues/14#issuecomment-73767649 .

diosney commented 9 years ago

I did that and didn't worked.

Don't worry, @graywolf336 already answered me clarifying about the changes he made to the module.

diosney commented 9 years ago

@khan4019 You can closed this issue too, its already merged and included in the README.

khan4019 commented 9 years ago

Awesome... thanks a lot... @diosney

neran27 commented 9 years ago

Hi All,

For dynamic data / REST binding.,

if (myTreeData.length == 0) { dataMiningFactory.getTreeData().success(function (data) { rawTreeData = data; myTreeData = getTree(rawTreeData, 'DemographicId', 'ParentId'); }); $timeout(function () { $scope.tree_data = myTreeData; }, 5000); }

This will do the purpose for me, but only when the tree alone is added in the page. But when integrated with other HTML elements, the data is returned but tree is not updated on the UI. :(