I’m loading a csv file from url. The csv has html, double quotes and commas (in text) in it. My resulting grid is misaligned (due to the commas) and not rendering the html.
How do I parse this csv file correctly? I don’t have the ability to edit the contents of the csv.
Any help would be very much appreciated.
Thanks!
Here’s what I’m working with:
<script>
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("http://173.199.131.236/~ociapps/grid/imgs/");
mygrid.setHeader("Site ID,Image,Type,Lead CM,Contact Name,Phone #,Status,Time,Notes,GC,Crew Type,2nd Tier Sub,EMS Walk,Construction Start,BTS Set,BTS Hot,GPS Installed,L&A Start,L&A Complete,RRU Complete,1900 Complete,800 Complete,Microwave Start,Microwave Complete,Construction Complete");
mygrid.attachHeader("#text_filter, ,#select_filter,#select_filter,#select_filter, ,#select_filter, , ,#select_filter, , , , , , , , , , , , , , , ");
mygrid.setInitWidths("100,90,90,140,140,120,90,90,300,140,100,140,90,90,90,90,90,90,90,90,90,90,90,90,90");
mygrid.enableSmartRendering(true);
//mygrid.enableAutoWidth(true);
//mygrid.enableAutoHeight(true);
//mygrid.enableHeaderMenu();
mygrid.setColAlign("left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left,left");
mygrid.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro,txt,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro");
mygrid.setColSorting("str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str");
mygrid.setSkin("dhx_terrace");
mygrid.init();
//mygrid.attachFooter("Total:,#cspan,#cspan,#stat_count,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan");
mygrid.enableCSVAutoID(true);
//mygrid.enableCSVHeader(true);
//mygrid.splitAt(2);
//mygrid.setCSVDelimiter("\",\"");
//mygrid.csvParser = mygrid.csvExtParser;
//mygrid.csv.row = '\n';
//mygrid.csv.cell = '\t';
//mygrid.load("https://www.quickbase.com/db/dfghfdgh?act=API_GenResultsTable&qid=32&options=csv.tab","csv")
mygrid.load("https://www.quickbase.com/db/dfghfdgh?act=API_GenResultsTable&qid=32&options=csv","csv")
//mygrid.load("https://www.quickbase.com/db/dfghfdgh?act=API_GenResultsTable&qid=32&jsa=1","jsarray")
</script>
This is the csv that is returned from the database:
Crew,Thomas H <57724108.cgcm>,Rob P,IN,7:04:35.190 am,"Mounting cabinets, pipe work, and getting the DC inter-connect installed today.",Civil,,,"<div align=""center"" style=""color:green;"">Complete</div>","<div align=""center"" style=""color:green;"">Complete</div>","<div align=""center"" style=""background-color:orange;"">Due Today</div>","<div align=""center"" style=""color:green;"">Complete</div>","<div align=""center"" style=""background-color:lightgreen;""></div>","<div align=""center"" style=""background-color:lightgreen;""></div>","<div align=""center"" style=""background-color:lightgreen;""></div>","<div align=""center"" style=""background-color:lightgreen;""></div>","<div align=""center"" style=""background-color:lightgreen;""></div>","<div align=""center"" style=""color:green;"">Complete</div>","<div align=""center"" style=""color:green;"">Complete</div>","<div align=""center"" style=""background-color:lightgreen;""></div>"