Skip to content
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

On table reload, "Uncaught TypeError: Cannot read property 'yadcf_data_0' of null" #227

Closed
EMTurano opened this issue Aug 18, 2015 · 11 comments

Comments

@EMTurano
Copy link

I updated to the latest stable release of YADCF, and the latest versions of DataTables and Editor. This error doesn't always occur when the table is reloaded, only some of the time.

log

@vedmack
Copy link
Owner

vedmack commented Aug 21, 2015

Not sure to which version your refering as latest stable, but try the newst from repo, and if still happens provide a link to the page so I can check it there

@EMTurano
Copy link
Author

You can view the issue here: https://www.dcturano.com/to-do_list2/

Updated to the latest beta. A few notes:

-This issue only occurs when an item on the table is deleted, and the page is reloaded.
-When an item is edited, it is successfully edited.

@vedmack
Copy link
Owner

vedmack commented Sep 3, 2015

From my quick check it seems that there is a different error before the one you reported

see console log:

Object {action: "remove", data: Object}
With JSON:
Object {data: Array[0]}
With action:
datatables.include-footer.1668b7.js:formatted:53397 remove
Uncaught TypeError: Cannot read property '0' of undefined
rowID=row_3147

Then after doing page refresh indeed your reported issue appear, its very easy to fix that error on yadcf side- (null check for the json coming back on table loading, BUT I never seen a scenario in which the json is coming back as null, so If you want I can add that null check on yadcf, but itd sure doesn't look healthy, IMO you should also find out why the json comes sometimes as null.

@EMTurano
Copy link
Author

EMTurano commented Sep 4, 2015

Could you point me in the direction to find out why it’s coming back as null? It doesn’t always do that, but it does sometimes when the page is reloaded.

Regards,
Eric

Software Design - dc|turano
www.dcturano.comhttp://www.dcturano.com | emt@dcturanoinc.commailto:emt@dcturanoinc.com | (310) 956-0284

On Sep 3, 2015, at 1:09 AM, Daniel Reznick <notifications@git.luolix.topmailto:notifications@github.com> wrote:

From my quick check it seems that there is a different error before the one you reported

see console log:

Object {action: "remove", data: Object}
With JSON:
Object {data: Array[0]}
With action:
datatables.include-footer.1668b7.js:formatted:53397 remove
Uncaught TypeError: Cannot read property '0' of undefined
rowID=row_3147

Then after doing page refresh indeed your reported issue appear, its very easy to fix that error on yadcf side- (null check for the json coming back on table loading, BUT I never seen a scenario in which the json is coming back as null, so If you want I can add that null check on yadcf, but itd sure doesn't look healthy, IMO you should also find out why the json comes sometimes as null.


Reply to this email directly or view it on GitHubhttps://github.com//issues/227#issuecomment-137372907.

@vedmack
Copy link
Owner

vedmack commented Sep 4, 2015

I would go and check your server code and try to debug and find out why it doesn't return a proper data

@vedmack vedmack closed this as completed Sep 4, 2015
@EMTurano
Copy link
Author

I wanted to send another issue your way. When DataTables Responsive is used and hidden rows are shown, fields with using YADCF and select options show all the options instead of only the selected option. You corrected this in a beta, but it seems to be back:

[image1.PNG]

Regards,
Eric

Software Design - dc|turano
www.dcturano.comhttp://www.dcturano.com | emt@dcturanoinc.commailto:emt@dcturanoinc.com | (310) 956-0284

On Sep 4, 2015, at 2:14 PM, Daniel Reznick <notifications@git.luolix.topmailto:notifications@github.com> wrote:

I would go and check your server code and try to debug and find out why it doesn't return a proper data

Reply to this email directly or view it on GitHubhttps://github.com//issues/227#issuecomment-137855181.

@vedmack
Copy link
Owner

vedmack commented Sep 10, 2015

@Xcellere , if you reproduce it on the showcase page (second table) http://yadcf-showcase.appspot.com/DOM_Ajax_Multiple_1.10.html please do an open a new issue, if you can tell in what version it did work and since what version it has stopped please mention it too,,,

vedmack added a commit that referenced this issue Sep 14, 2015
slight docs update
@vedmack
Copy link
Owner

vedmack commented Sep 14, 2015

replaced uncaught message with console.log (just in case)

@mrcrbrown
Copy link

@vedmack the test for undefined won't be hit for me. I'm seeing the json parameter return as null instead of undefined. My scenario is that the datatable is populated after the table is painted. The initial json return is empty so that the datatable has no rows.

@vedmack
Copy link
Owner

vedmack commented Sep 16, 2015

Sending a PR changing === into == is shorter than the above post :) If not, I will commit it in the following days

vedmack added a commit that referenced this issue Sep 17, 2015
@vedmack
Copy link
Owner

vedmack commented Sep 17, 2015

fixed in 0.8.9.beta.18

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

No branches or pull requests

3 participants