function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KyleJ GorgesKyleJ Gorges 

Community Template with Lightning Component and Datatables

We are attempting to build a lightning component for our salesforce community.  We are using the Napili template.  We want to use jQuery datatables in the lightning component (to allow for sorting, paging, and searching).  The lightning component is placed on a page referenced by a tab on the standard template nav bar.  When we first load the page, everything looks good, the datatable operates correctly.  When we click on another nav link (or even the same nav link again), the datatable loses its data (it isn't apparent at first, but when you click on a column to sort the table, the data disappears - a "No data" message is in the table).  Our datatable call is done in afterRender.  If we refresh the browser, everything works fine again.  Just navigating away from the tab and then back within the community do we see this problem.  

The data is populated in our apex controller via a doInit function in the component controller.  We know the data is getting populated properly because if we don't make the datatable call, we see the data in a normal table.

Has anybody seen this or have any suggestions?
 
Poornima VelmururganPoornima Velmururgan
Hello Kyle,

You can try our new Lightning component, Lightning Datatable Dev at Appexchange https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000E9TBZUA3 and take a test drive to see If this can satisfy your request. This Lightning component simply allows you to Search, Sort, Pagination, Table level Actions, Row level actions and mass update actions.  You have to just prepare the JSON Data and provide them as an input to the component. Check out our blog http://blog.softsquare.biz/embrace-lightning-with-lightning-datatable-dev/ for more info or contant us directly for more support at poornima@softsquare.biz.

Hope this helps you!

Thanks.