Reactive-table Blaze object properties in columns


#1

I am using the aslagle:reactive-table (https://atmospherejs.com/aslagle/reactive-table), in order to display the property values of a Session object of the following format:

Object= {property_1: [0,1,2],
property_2:[1,2,3],
property_3:[50,52,2] }

in a reactive table with pagination etc features that it supports. The problem is that the values of the properties are arrays, of which every element i want to be represented in rows. With the current implementation though they are returned in a single row.

Below is the code in html :

<template name="reactDemo">
    {{> reactiveTable class="table table-bordered table-hover" collection=myCollection fields=fields settings=settings}}

</template>

and in js file respectively:

Template.reactDemo.helpers({

myCollection: function () {
myCollection=Session.get("Object")
return myCollection ;
},
settings: function () {
    return {
        rowsPerPage: 10,
        showFilter: true,
        fields: [{ 
                    key:'property_1',
                    label:'name',
                    //sortable:false,
                    fn:function(value){
                        for (i=0; i<value.length;i++){
                            return value[i]
                        }

                    }
                },

                {
                    key: 'property_2',
                    label:'property 2',

                    fn:function(value){
                        for (i=0; i<value.length;i++){
                         return value[i]
                        }

                     }
                },
                {
                    key: 'property_3',
                    label:'Price',
                    fn:function(value){
                        for (i=0; i<value.length;i++)
                        return value[i]
                     }
                }]
    };
}
});

what shall I change in the above?