Display Large Chunks of Data in a Jiffy with Data Tables in Rails for Non-profit Fundraising Software Solutions
TABLE OF CONTENTS
One of the major issues faced by non-profit organizations that conduct successful fundraising campaigns is that of data. Large amounts of data imposes several challenges on your non-profit fundraising software solution or charity donation platforms.
When a large amount of data is loaded, not only it increases the server load but it also affects the performance of your platform. The situation can be extremely frustrating as data in large amounts also increases the loading time of the UI components and makes your platform slow.
Hence to combat the challenge of displaying a large set of data in a table, one of the Ruby on Rails developers, Vaibhav Gupta from GammaStack came up with a simple solution.
There are three possible solutions when it comes to displaying a large amount of data in a table.
- Simply send the data to the client in an object. The client will render the data from the object via iterating over the object and fetching the data.
- Secondly, we can use a jQuery plugin to create data tables at the client-side.
- Thirdly, we can use server-side data tables along with the jQuery plugin.
In this article, we’ll be using the third approach. Why? Because it comes with several benefits.
Benefits of Third Approach
The client-side jQuery plugin will provide sorting, pagination and searching capabilities to our tables. But it will run into performance issues when the data set is large. So if we perform pagination capabilities at the server-side, it will boost up the performance.
Installation
For client-side Data table installation, we can refer
https://github.com/jbox-web/ajax-datatables-rails
While for the server-side data table installation, we can refer
https://github.com/mkhairi/jquery-datatables
Example:-
This is our table.
This is the server-side data table code-snippet.
Here we have used one more library
https://github.com/drapergem/draper which helps us in separating the presentation/view logic from data filtering logic.
The below code snippet is of the decorator.
The below code snippet is of the HTML code.
The below code snippet is of the script at the client-side.
The above solution by Vaibhav Gupta has rectified the challenge for several non-profit organizations and has helped them decrease the loading time of their platforms drastically. Up to 4000 records can be loaded within 1 sec without affecting the performance of the platform.
GammaStack provides high-performing and feature-rich non-profit fundraising software solutions and charity donation platforms that help non-profit organizations conduct successful campaigns and boost their funds. In addition to this, our charity donation platforms come equipped with donor management tools, volunteer management tools, marketing tools, software integrations, analytics, admin dashboards, payment gateways, leaderboards, and many more features.
GammaStack also provides diverse fundraising solutions such as team fundraising software, nonprofit donor management software, community engagement software, crowdfunding platform software, and custom solutions.
Want to get your hands on a feature-loaded fundraising software solution? Contact us today!
About the author:
Vaibhav Gupta,
Ruby on Rails developer at GammaStack