Skip to content

Set headers#32

Open
sergiyvoytovych wants to merge 1 commit intorikkertkoppes:masterfrom
sergiyvoytovych:master
Open

Set headers#32
sergiyvoytovych wants to merge 1 commit intorikkertkoppes:masterfrom
sergiyvoytovych:master

Conversation

@sergiyvoytovych
Copy link
Copy Markdown

Added possibility to set header for a column

//cols
res.cols = fields.map(function(key,i) {
return {
caption: headers[i],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When config is undefined, fields instanceof Array === true.
So it would not go in to the if case telling in line 56 and headers remain [].

When json is not empty([] || {}), fields is also not empty, then headers would not match fields.
headers[i] in line 68 would be undefined, resulting to the following failure of test.

image

## fix it
Replace headers[i] to headers[i] !== undefined ? headers[i] : key in line 68.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants