I am having trouble displaying data using jQuery File Tree plugin. No matter what I use for 'root', it always uses '\' and displays content of C drive!
I am using aspx (with code behind that I am not using) and a master page.
<div class="col-md-12" id="divAIMDocs">
</div>
<script>
function openFile(file) {
// do something with file
alert(file);
}
$(document).ready(function () {debugger
$('#divAIMDocs').fileTree({
root: decodeURI(uploadFolder),
script: '../assets/vendor/jquery_FileTree/connectors/jqueryFileTree.aspx',
expandSpeed: 1000,
collapseSpeed: 1000,
multiFolder: false
}, function(file) {
openFile(file);
});
});
</script>
I added a breakpoint in venodr's js file (below) as well as the 'connector' script:
$(this).each( function() {
function showTree(c, t) {debugger <-- this shows 't' as '\'
$(c).addClass('wait');
and in connector script, jqueryFileTree.aspx:
string dir;
if(Request.Form["dir"] == null || Request.Form["dir"].Length <= 0) <-- always null
dir = "/";
else
dir = Server.UrlDecode(Request.Form["dir"]);
I then tried to hard code 'root' value to 'D:\Some\Folder':
$(document).ready(function () {debugger
$('#divAIMDocs').fileTree({
root: 'D:\Some\Folder\',
script: '../assets/vendor/jquery_FileTree/connectors/jqueryFileTree.aspx',
...
and I see in function showTree parameter 't' is now actually seeing 'D:\Some\Folder' but connector still says Request.Form["dir"] is null and proceeds to show content of C drive.
What a I doing wrong here?