How to make column.template reach all rows which are not visible on screen

I am using column.template = function(oRowData, common, value, config){} and want to iterate through all rows but its only going through all the rows seen on screen but as i have pagination its not going through rows on other pages is there any alterante template or a way to overwrite this.

Hello @Prashanth_Allamreddy ,

I understand that you’re trying to iterate through all rows, but it’s important to clarify that the column.template function is primarily designed for rendering rows in the table.
If your goal is to make modifications on the entire dataset (including rows not currently visible), I recommend using data schemes. Data schemes allow you to manipulate the data directly, and they will trigger whenever rows are added to the table.

Please take a look at the example: Code Snippet

Could you please clarify what specific actions or modifications you want to perform on the rows? Understanding your end goal will help me provide more targeted guidance.

1 Like

In my use case is like i am trying to add formatting in a column cell and while the column template iterates i am trying to store all the newly formatted values, but i see that during run time its just storing the values in the first page. and i dont think using data schemes will do it for me in this case

To solve your issue with storing formatted values, you can try two approaches:

  • You can change your data schema by adding a new field that holds the formatted value. This way, you can easily reference this field in your column template(rows 9 and 18 in the example).

Here is a working example of this approach: Code Snippet

  • If you prefer not to modify the original data structure, you can maintain a separate object to store the formatted results. In your column template, you can check for this formatted value and return it if available; otherwise, you can return the original value.

Please check the example: Code Snippet

If this approaches don’t help you, could you please clarify the following points:

  • Why do you need to store formatted values?
  • Will the table need to support sorting and filtering based on the formatted values or the original values?
  • Will the formatted results be editable? If users need to update these values, you’ll need to consider how to handle updates to both the original and formatted data.
1 Like