diff options
Diffstat (limited to 'ecomp-portal-FE/client/bower_components/jqTree/_entries/18_data-url.md')
-rw-r--r-- | ecomp-portal-FE/client/bower_components/jqTree/_entries/18_data-url.md | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ecomp-portal-FE/client/bower_components/jqTree/_entries/18_data-url.md b/ecomp-portal-FE/client/bower_components/jqTree/_entries/18_data-url.md new file mode 100644 index 00000000..063c1514 --- /dev/null +++ b/ecomp-portal-FE/client/bower_components/jqTree/_entries/18_data-url.md @@ -0,0 +1,45 @@ +--- +title: dataUrl +name: options-data-url +--- + +Load the node data from this url. + +{% highlight js %} +$('#tree1').tree({ + dataUrl: '/example_data.json' +}); +{% endhighlight %} + +You can also set the **data-url** attribute on the dom element: + +{% highlight html %} +<div id="tree1" data-url="/example_data.json"></div> +<script> + $('#tree1').tree(); +</script> +{% endhighlight %} + +You can set additional [jquery ajax options](http://api.jquery.com/jQuery.ajax/) in an object: + +{% highlight js %} +$('#tree1').tree({ + dataUrl: { + url: '/example_data.json', + headers: {'abc': 'def'} + } +}); +{% endhighlight %} + +Or you can use a function: + +{% highlight js %} +$('#tree1').tree({ + dataUrl: function(node) { + return { + url: '/example_data.json', + headers: {'abc': 'def'} + }; + } +}); +{% endhighlight %} |