We observed that the code provided by you is incomplete, can you please create a jsfiddle, with the complete code along with your sample data so that we can understand the code better and help you out.