wl.api ....我的Javascript是垃圾 [英] wl.api .... my Javascript is rubbish

查看:106
本文介绍了wl.api ....我的Javascript是垃圾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我发现移动设备不支持skydrivepicker,我一直在玩fancytree
http://wwwendt.de/tech/fancytree/demo/

Since I've discovered the skydrivepicker is not supported on mobile devices I've been playing with fancytree http://wwwendt.de/tech/fancytree/demo/

我正在尝试延迟加载树节点工作,但我正在努力使用javascript。

I'm trying to get lazy loading of tree nodes to work but I'm struggling with the javascript.

Fancytree有一个lazyload选项,必须将新的子项返回到data.result ....例如

Fancytree has a lazyload option that must return the new child items into data.result.... e.g.

lazyload:

function (事件,数据){

function(event, data) {

//获取数据

data.result = somearray;

data.result = somearray;

}

I我叫WL .api在"lazyload"中。但是当WL.api返回数据时,我需要填充data.response。

I'm calling WL.api within "lazyload" but I need to populate data.response when WL.api returns the data.

例如

lazyload:function(event,data){

lazyload: function(event,data) {

         cd = [];

         cd = [];

         WL.api({

         WL.api({

            path:data.node.id +" / files" ;,

            path: data.node.id + "/files",

            method:" GET"

            method: "GET"

          })。then

           }).then

        ;       功能..................

               function..................

我坚持的是如何识别WL.api已完成并在lazyload函数完成之前将结果传递回lazyload函数。

The bit I'm stuck on is how to recognise that WL.api has completed and to pass the result back to the lazyload function before the lazyload function completes.

推荐答案

这里有一些文档和示例,说明如何使用WL.api(...)

http: //msdn.microsoft.com/en-us/library/live/hh550838.aspx

http://msdn.microsoft.com/en-us/library/live/hh550838.aspx

http://msdn.microsoft.com/en-us/library/live/hh826531#reading_folders

Lin


这篇关于wl.api ....我的Javascript是垃圾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆