New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$.csv.parsers.splitLines(csv) does not work #27

Closed
evanplaice opened this Issue Sep 9, 2015 · 4 comments

Comments

Projects
None yet
1 participant
@evanplaice
Owner

evanplaice commented Sep 9, 2015

From dirk.ste...@wondergraphs.com on April 07, 2013 11:09:09

Returns:

Uncaught TypeError: Cannot read property 'separator' of undefined jquery.csv-0.71.min.js:27
$.csv.parsers.splitLines jquery.csv-0.71.min.js:27

When I add the optional configuration {separator: "," , delimiter: "\x22" } the console returns:

Uncaught TypeError: Cannot read property 'rowNum' of undefined jquery.csv-0.71.min.js:27
$.csv.parsers.splitLines jquery.csv-0.71.min.js:27

Original issue: http://code.google.com/p/jquery-csv/issues/detail?id=26

@evanplaice evanplaice added this to the backlog milestone Sep 9, 2015

@evanplaice

This comment has been minimized.

Show comment
Hide comment
@evanplaice

evanplaice Sep 9, 2015

Owner

From dirk.ste...@wondergraphs.com on April 07, 2013 11:20:26

Checked the source and it's a simple problem of an empty options.state object.

Line 278: if(!options.state.rowNum)

When I pass in an option like this it works:
var splitLines = $.csv.parsers.splitLines(t, {separator: ",", delimiter: "\x22", state: { } });

Owner

evanplaice commented Sep 9, 2015

From dirk.ste...@wondergraphs.com on April 07, 2013 11:20:26

Checked the source and it's a simple problem of an empty options.state object.

Line 278: if(!options.state.rowNum)

When I pass in an option like this it works:
var splitLines = $.csv.parsers.splitLines(t, {separator: ",", delimiter: "\x22", state: { } });

@evanplaice

This comment has been minimized.

Show comment
Hide comment
@evanplaice

evanplaice Sep 9, 2015

Owner

From evanpla...@gmail.com on April 07, 2013 21:25:38

I'll take a look at it.

I added more state tracking on the last update and probably just missed the default state object creation on the splitLines method.

Thank you for the feedback.

Owner

evanplaice commented Sep 9, 2015

From evanpla...@gmail.com on April 07, 2013 21:25:38

I'll take a look at it.

I added more state tracking on the last update and probably just missed the default state object creation on the splitLines method.

Thank you for the feedback.

@evanplaice

This comment has been minimized.

Show comment
Hide comment
@evanplaice

evanplaice Sep 9, 2015

Owner

From evanpla...@gmail.com on April 22, 2013 17:59:26

If you want a quick and dirty fix. Just add a 'state' object literal with rowNum and colNum both initialized to 0.

To see what I mean, just take a look at some of the other functions. The proper fix would be to make splitLines so it inherits its state from the function arguments with defaults as a fallback.

Owner

evanplaice commented Sep 9, 2015

From evanpla...@gmail.com on April 22, 2013 17:59:26

If you want a quick and dirty fix. Just add a 'state' object literal with rowNum and colNum both initialized to 0.

To see what I mean, just take a look at some of the other functions. The proper fix would be to make splitLines so it inherits its state from the function arguments with defaults as a fallback.

@evanplaice

This comment has been minimized.

Show comment
Hide comment
@evanplaice

evanplaice Sep 9, 2015

Owner

From evanpla...@gmail.com on December 09, 2013 15:32:06

Status: Accepted
Owner: evanpla...@gmail.com

Owner

evanplaice commented Sep 9, 2015

From evanpla...@gmail.com on December 09, 2013 15:32:06

Status: Accepted
Owner: evanpla...@gmail.com

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