ptrwlr
July 14, 2020, 7:33pm
1
Hi community,
i want to use a table like in JavaScript Table Viw Node inside a Generic JavaScript View Node.
I want to use bootstrap-table.js or jquery.datatables.js
I tried it with the bootstrap-table source code from here:
https://unpkg.com/browse/bootstrap-table@1.17.1/dist/bootstrap-table.css
I copied the source code into a table, created a flow variable to pass the code into Generic JavaScript View Node.
If i try do create the table like in the documentation here
https://examples.bootstrap-table.com/#welcomes/from-data.html#view-source
i get the following error:
TypeError: $(ā¦).bootstrapTable is not a function ā¦
Same error when using datatables.js
Can anyone help me with this?
BR
Hi @ptrwlr ,
I tried to apply @AlexanderFillbrunn solution from my previous problem to this
Hi,
I agree that it can be cumbersome to get this to work. Most of the time, the problem is that the Asynchronous Module Definition hijacks the module. I circumvent this by manually defining module and exports objects, then create a require function that returns exactly what the imported module needs and reset everything again after the module has loaded. Also, I usually load external dependencies via GET Request node and then insert them via flow variable. The code in the Generic JS View lookā¦
It seems to work somewhatā¦just looks ugly compared to the example
bootstrap.knwf.knwf (49.4 KB)
I really hope the generic Javascript View will get a better support for js-dependencies in the futureā¦
4 Likes
swebb
July 14, 2020, 9:11pm
3
Nice trick to know
I think itās not working as expected because the core bootstrap javascript and css arenāt included and it doesnāt seem to be loading the table specific css properly.
Hereās what Iāve been able to get it to show, I think that matches the example?
What I did was add the bootsrap CSS in the first CSS editor, the table bootstrap CSS in the second and use the flow variable to set the CSS in the generic JavaScript view.
Another way of using the library:
bootstrap.knwf.knwf (491.3 KB)
5 Likes
ptrwlr
July 15, 2020, 5:36am
4
Hi @AnotherFraudUser ,
this trick does it. Great.
Many thanks.
Hi @ptrwlr ,
great!
@swebb thank you for your solution as well!
Will definitely try to apply that for my previous problems.
ptrwlr
July 16, 2020, 9:47am
6
Hi community,
could it be that the ārequire trickā does affect the following hack?
window.top.addEventListener(āloadā, (event) => {
parent.document.querySelector(".knime-panel-header").style.display = ānoneā;
});
parent.document.querySelector(".knime-panel-header").style.display = ānoneā;
Itās not working anymore.
system
Closed
July 23, 2020, 9:48am
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.