I'm trying to set the selected file in ckfinder using the ASP.NET version.
Since I couldn't find a way to do this from the server side, I used the following javascript code which only works in CKFinder 2.0.1 (not 2.1) and doesn't work in IE8 so I'm looking for a better solution. The problem is that sometimes I can't get a reference to the CKFinder javascript object. Any suggestions would be appreciated.
var ckfinder = window.frames[0].globalapi;
if (ckfinder) {
foundFile = false;
var fileslist = ckfinder.files;
for (var x = 0; x < fileslist.length; x++) {
if (fileslist[x].name == filename) {
ckfinder.files[x].select();
foundFile = true;
}
Thanks,
David
}
Since I couldn't find a way to do this from the server side, I used the following javascript code which only works in CKFinder 2.0.1 (not 2.1) and doesn't work in IE8 so I'm looking for a better solution. The problem is that sometimes I can't get a reference to the CKFinder javascript object. Any suggestions would be appreciated.
var ckfinder = window.frames[0].globalapi;
if (ckfinder) {
foundFile = false;
var fileslist = ckfinder.files;
for (var x = 0; x < fileslist.length; x++) {
if (fileslist[x].name == filename) {
ckfinder.files[x].select();
foundFile = true;
}
Thanks,
David
}
Re: How to set selected file with ASP.NET