Skip to content
Advertisement

render javascript component (ag-grid) in r shiny

I am trying to include the most basic example of ag-grid from their website in a R-shiny application, starting from there I will add more and more trying to setup a proper communication frontend-backend on data edit. However I am stuck at the basics of the inclusion. The component is included in source code but not rendered:

This is the basic example from ag-grid website: https://plnkr.co/edit/nmWxAxWONarW5gj2?p=preview%3Fp%3Dpreview&preview

This is my R-Shiny application

JavaScript

where in www folder I have script.js that is a simple copy paste of the content of main.js from the example linked above.

JavaScript

Any hint on how to proceed? The console is unfortunately not telling me anything relevant, css cdn and local script are read properly, but for some reasons it is not rendering the output.

Advertisement

Answer

  1. You don’t want to use something directly inside renderUI to directly modify the uiOutput container.
  2. The table container must have some initial height and width.
  3. Since this is loaded after the document is ready in a renderUI event, addEventListener('DOMContentLoaded' should not be used. Document will not be ready again, so this listener will not be triggered.
JavaScript
JavaScript

enter image description here

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement