On OSX, I have an old Appcelerator Titanium app, that I want to migrate it to the new TideSDK platform.
Now, I can:
But an invocation to Titanium.UI.openFileChooserDialog(parseCsvFile,options);
doesn't do anything. Below is what the current code looks like. How can I get a Dialog FileChooser invoked in TideSDK ?
function selectFile() {
var options = {
multiple : false,
title : "Open file",
types : ['csv', 'txt'],
typesDescription : "CSV files",
path : Titanium.Filesystem.getUserDirectory()
}
Titanium.UI.openFileChooserDialog(parseCsvFile,options);
}
Thanks
The correct command needs to happen from within a window, like this:
Ti.UI.currentWindow.openFileChooserDialog(function(e) {
// Do stuff after the user has closed the dialog here
...
}, { // Specify options
multiple: false,
title : "Open file",
types : ['csv', 'txt'],
path : Ti.Filesystem.getUserDirectory()
});