I created jqxgrid with data loading from my csv. I wish to show url in last column but data csv file i have, has urls somewhere like “www.google.com” (with double quotes)and somewhere like http://www.google.com (without double quotes). So How can I set link in cell by trimming wherever double quotes are there.
Also some values in data csv file have garbage value (“no-name”) for column “NAME”, so what i want to do whenever name is “no-value” cell in column “NAME” should have cell value as “STUDENT”
Code I made is :
$(document).ready(function () {
var hght=window.innerWidth;
var url = ‘mydata.csv’;
var source =
{
datatype: “csv”,
datafields: [
{ name: ‘url’, type: ‘string’ },
{ name: ‘name’, type: ‘string’ },
{ name: ‘age’, type: ‘string’ },
{ name: ‘category’, type: ‘string’ }
],
url: url
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#jqxgrid”).jqxGrid(
{
sortable: true,
autoheight: true,
autorowheight: true,
source: dataAdapter,
columnsresize: true,
columns: [
{ text: ‘Name’, datafield: ‘name’, width: 250},
{ text: ‘Age’, datafield: ‘age’, width: 300 },
{ text: ‘Category’, datafield: ‘category’ },
{ text: ‘Link’, datafield: ‘url’}
],
width:hght*0.98
});
});
Hope you will help soon