Created
March 11, 2013 23:40
-
-
Save csessig86/5138959 to your computer and use it in GitHub Desktop.
DataSet > DataTables part 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load up the CSV using Miso.Dataset | |
$(document).ready( function() { | |
// Change URL to the right path for your CSV | |
var ds = new Miso.Dataset({ | |
url : 'csvs/salary_book_clean.csv', | |
delimiter : ',' | |
}); | |
// Run this after we load our CSV | |
ds.fetch({ success : function() { | |
this.each(function(row, rowIndex) { | |
// Change these variables to match your column names | |
var employeeData = row.Employee; | |
var departmentData = row.Department; | |
var salaryData = row.TotalFY12Salary; | |
var genderData = row.Gender; | |
var countyData = row.County; | |
var positionData = row.Position; | |
// Put information in an array and push it to our table | |
// Change these variables to match variables above | |
var myArray = [employeeData, departmentData, salaryData, genderData, countyData, positionData]; | |
newDataSet.push(myArray); | |
}); | |
// Call DataTable function showInfo | |
showInfo(); | |
}}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment