Trying to get my head around BSdatatables. Following is my code, largely BSDatatable sample, but DataTable1.build() doesn’t seem to refresh the table. If I click on a cell it shows me the data from my arrays but it’s not displayed. Just shows 2 rows and 3 cols from design screen. It works with my data in the sample project but I can’t get it into my project. Any ideas?
JavaScript
var columns1 = [
{title: "code"},
{title: "name"},
{title: "stocktype"},
{title: "cost"},
{title: "qtyonhand"},
{title: "minreqrd"},
{title: "maxreqrd"},
{title: "onorder"},
{title: "sellprice1"},
{title: "sellprice2"},
{title: "sellprice3"},
{title: "margin1"},
{title: "margin2"},
{title: "margin3"},
{title: "onhand"},
{title: "sell1"},
{title: "sell2"},
{title: "sell3"},
];
var data1 = [
["INSYTECATHETER","BD Insyte Catheter 22G x 1","6","2.75","5","0","0","0","5.5","4.68","4.68","100","70.1818","70.1818","5","5.5","4.68","4.68"],
["0DIB1H","Don't use Expired2","1","0","0","0","0","0","38.68","35.31","35.31","0","0","0","0","38.68","35.31","35.31"],
["0DIB2H","Don't use Expired3","1","0","0","0","0","0","12.06","11.74","11.74","0","0","0","0","12.06","11.74","11.74"],
["0DIB3H","Don't use Expired4","1","0","0","0","0","0","6.9","6.97","6.97","0","0","0","0","6.9","6.97","6.97"],
["1-XX","Penalty interest5","1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]
];
End JavaScript
Function Form1Main()
updateTable()
End Function
Function DataTable1_onclick(event)
If typeof(event.target._DT_CellIndex) <> "object" Then return
Dim row, col
row = event.target._DT_CellIndex.row
col = event.target._DT_CellIndex.column
MsgBox "Click on " & row & ", " & col & ". Value is '" & data1[row][col] & "'."
End Function
Function updateTable()
DataTable1.settings.columns = columns1
DataTable1.settings.data = data1
DataTable1.build()
End Function