I’ve gone through the sample file for Datatables (BS4 in BASIC) and am getting nowhere. I’ve made an extremely cut down version of the original sample and can not for the life of me work out why it won’t show my new column names and my data.
Any help appreciated.
JavaScript
var data1 = [
["1", "John", "2000", "100"],
["2", "Shane", "1000", "99"],
["3", "Andrew", "500", "98"]
];
var dataJson = JSON.stringify(data1);
var columns1 = [
{title: "RANK"},
{title: "PLAYER"},
{title: "SCORE"},
{title: "PTS"}
];
End JavaScript
Function Button1_onclick()
dt.clear
dt.settings.columns = columns1
dt.settings.data = data1
dt.build()
End Function
dt is the name of my datatable
I’ve just added a Button which I was hoping would change the datatable and put my data in it, but it really does nothing except make the datatable expand and fit the container I have it in.