Recreate graphic animations on Jquery datatable refresh

Author - Parminder Kaur
16.04.2018
|
0 Comments
|

When we refresh Jquery datatables (like through sorting or searching) the graphic animations like progress circle-bars etc do not redraw correctly. The distorted images appear instead of graphics.

This is how progress circles look initially:

On sorting/searching the dataTable, the progress circle is not redrawn correctly, like in below screenshot:

So to resolve this, we need to redraw the dataTable and progress circles to apply the @key-frame css again.

To redraw a table, we can use this Jquery function:

$(tableId).on( 'draw.dt', function () { //Redraw dataTable
$(“#circlebar_id”).Circlebar({ /*Redraw the distorted circle on
given row */
maxValue: 50, //Progress Value
triggerPercentage: true,
type: "progress",
dialWidth: 4,
size: "45px"
});
});

We need to redraw both dataTable and Progress Circle to get the right graphic animation. Redrawing only one element will not give the required result.

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *

Send your message