Often times the data object keys and the header names are not same. So I've added option to pass header in the form of object. The keys would be same as that of the keys of the data to be shown and the value would be used as the header of the column for that key. Also the sequence of keys don't matter. They will be ordered according the the header object passed.
In above array one object has addr field missing. So age would be shown in addr's column with the current implementation. Also I would like addr's column header name to be 'Address' and sr_no to be 'Sr. no'. To handle this scenario's I've made some changes. Please go through them.
Often times the data object keys and the header names are not same. So I've added option to pass header in the form of object. The keys would be same as that of the keys of the data to be shown and the value would be used as the header of the column for that key. Also the sequence of keys don't matter. They will be ordered according the the header object passed.
For example :
In above array one object has addr field missing. So age would be shown in addr's column with the current implementation. Also I would like addr's column header name to be 'Address' and sr_no to be 'Sr. no'. To handle this scenario's I've made some changes. Please go through them.
For the above data, header object would be
and to use this object one needs to pass
useObjHeader: true
with the above objHeader