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

Fix unhandled error thrown during a draw operation #768

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mihalicyn
Copy link

Dear friends,

I propose patch that fixes "unhandled error thrown during a draw operation" in breakpoints and editing components. Please check and pull my changes if it's useful.

About fixes:

  1. In breakpoints component I added missing current property assignment and check in draw method.
  2. In editing component it's very important to check that component already initialized (check enabled property) before using $cell property because it's may be undefined.

Info:
This bug is very hard to catch (frequency of appearing is very small). I had used ft.rows.load method to add rows to table after Footable initialization. Sometimes I caught strange behavior -- table won't load rows and shows "No data" (or something similar). In console I got errors.

FooTable: unhandled error thrown during a draw operation. TypeError: Cannot read property 'attr' of undefined
    at Class.draw (footable.js:6403)
    at Object.<anonymous> (footable.js:2295)
    at Function.Deferred (jquery.min.js:2)
    at obj._execute (footable.js:2293)
    at Object.<anonymous> (footable.js:2305)
    at Object.<anonymous> (jquery.min.js:2)
    at i (jquery.min.js:2)
    at Object.add [as done] (jquery.min.js:2)
    at Array.<anonymous> (jquery.min.js:2)
    at Function.each (jquery.min.js:2)
FooTable: unhandled error thrown during a draw operation. TypeError: this.current is null
Stack trace:
F.Breakpoints<.draw@http://localhost/app/biobank/js/footable.js:2803:4
F.Table<._execute/<@http://localhost/app/biobank/js/footable.js:2295:19
.Deferred@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28971
F.Table<._execute@http://localhost/app/biobank/js/footable.js:2293:11
F.Table<.execute@http://localhost/app/biobank/js/footable.js:2269:11
F.Table<.draw/</<@http://localhost/app/biobank/js/footable.js:2221:13
.Deferred/d.then/</</<@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28467
n.Callbacks/i@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:27146
n.Callbacks/j.add@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:27450
.Deferred/d.then/</<@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28439
.each@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:2859
.Deferred/d.then/<@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28385
.Deferred@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28971
.Deferred/d.then@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28362
F.Table<.draw/<@http://localhost/app/biobank/js/footable.js:2220:12
.Deferred/d.then/</</<@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28467
n.Callbacks/i@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:27146
n.Callbacks/j.add@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:27450
.Deferred/d.then/</<@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28439
.each@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:2859
.Deferred/d.then/<@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28385
.Deferred@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28971
.Deferred/d.then@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:28362
F.Table<.draw@http://localhost/app/biobank/js/footable.js:2213:11
@http://localhost/app/biobank/js/footable.js:7189:10
__extend__/proto[name]</<@http://localhost/app/biobank/js/footable.js:775:13
F.Rows<.load@http://localhost/app/biobank/js/footable.js:3561:4
.success@http://localhost/app/biobank/js/tablehandlers.js:155:17
n.Callbacks/i@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:27146
n.Callbacks/j.fireWith@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:2:27914
z@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:4:12057
.send/c/<@http://localhost/app/biobank/vendors/jquery/dist/jquery.min.js:4:15619
  footable.js:2243:6

May be connected with similar issue:
#733

Thanks.
Alex.

@mihalicyn mihalicyn closed this Jan 31, 2018
@mihalicyn mihalicyn deleted the feature/unhandledErrorInDrawOperationFix branch January 31, 2018 13:58
@mihalicyn mihalicyn restored the feature/unhandledErrorInDrawOperationFix branch January 31, 2018 14:02
@mihalicyn mihalicyn reopened this Jan 31, 2018
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.

1 participant