loadfilelist(folder,funcwhendone)

Parameters

- folder the folder you want to list files in (in DfW the static/folder is added in front of the given folder to make it work the same as in server)

- funcwhendone the function called when the file list are fetched. Default the updatefilelistgui(jdata) is called. Format of the expected function is function(jdata) where jdata is the returned json from the call.

This method list all files in a folder.

Example used in DQL editor

// init code in editor
dec.loadfilelist('/MyDQLs/');

// called default when files returned
this.updatefilelistgui=function(jdata){
    if (jdata.result='ok'){
        var files = jdata.files;
        if (files){
            var thehtml = '';
            for (var idx=0;idx<files.length;idx++){
                var fob=files[idx];
                if (fob && fob.type == 'file'){
                    thehtml+='<div class="afile naviteml2">';
                    if (_this.indataease)
                        thehtml+='<a href="./DQLEdit.html?&file=/MyDQLs/'+fob.name+'">';
                    else
                        thehtml+='<a href="/DSEditors/DQLEdit.html?&file=/MyDQLs/'+fob.name+'">';
                    thehtml+=fob.name+'</a></div>';
                }
            }
            $("#dqls").html(thehtml);
        }
    }
}

List all files in MyDQLs and put them on the side menu