rodney
March 2, 2020, 4:05pm
1
Hi
I am having issues when I have multiple datatables on a form. I would like to use about 4 datatables.
There seems to be some timing conflict with the NSB code when I go beyond 3.
It gives the following exception. (Jquery.datatable failed into insertBefore on Node…)
The conflicting code looks like it comes from NSB when it tries to do a build() on the tables from a setTimeout event.
Is there anyway that this can be turned off or is there something else I need to look at?
Many Thanks
ghenne
March 2, 2020, 4:18pm
2
I’ve used multiple datatables on a form without problems, so that’s not the direct issue. I haven’t seen your problem before.
DataTables isn’t our product, though it works well with AppStudio. We’re not experts in it, so we can’t tell you how to fix it. Keep digging - it’s a solid library and there’s always a good reason for things happening the way they do.
rodney
March 3, 2020, 6:58am
3
Just a question, why do you initialize the data tables in the NSB “Load” code?
setTimeout('repOpenOrders.build()',500);
data = [['Tiger Nixon', 'System Architect', '$320,800'],['Garrett Winters', 'Accountant', '$170,750']];
columns = [{title:'Name'}, {title:'Position'}, {title:'Salary'}]
NSB.bs.addProperties(repOrderHistory, 'DataTable_bs4');
repOrderHistory.settings={
data: data,
info: true,
lengthChange: true,
lengthMenu: [5, 10, 25],
ordering: true,
paging: false,
searching: true,
columns: columns
}
This is the build() that is causing my issue.
Thanks
Rodney
ghenne
March 3, 2020, 11:20am
4
Just a guess - repOpenOrders.build()
is being called with a half second delay. That may be too soon.
By putting it in the load code, it should wait until the table is completely loaded before trying to insert values into it.
rodney
March 3, 2020, 4:07pm
5
Hi George
That code is part of the NSB generated code. (index.html)
I don’t have control over the delay do I?
Thanks
Best Regards
Rodney
ghenne
March 3, 2020, 5:52pm
6
You’re right - we’d better have a look at that. Thank you!