HTML and CSS Reference
In-Depth Information
Finally, lets add the call to saveAll in our code:
function loadFromCSV(event) {
var reader = new FileReader();
reader.onload = function(evt) {
var contents =;
var lines = contents.split('\n');
var tasks = [];
$.each(lines, function(indx, val) {
if (indx >= 1 && val) {
var task = loadTask(val);
if (task) {
storageEngine.saveAll('task', tasks, function() {
reader.onerror = function(evt) {
errorLogger('cannot_read_file', 'The file specified cannot be read');
With this in place, you should be able to load a CSV file and have the contents immediately
reflected in the tasks table. In addition; it is also possible to use this functionality without
connectivity to a web server, since all the processing is occurring entirely on the client.
Search WWH ::

Custom Search