-
Notifications
You must be signed in to change notification settings - Fork 31
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
AbstractDataTable onLoad() makes for difficult initialization #11
Comments
Can you provide an example of what you are trying to accomplish, I will revise it based on the use case you require if it is better. Thanks! |
I have something like that (create columns in constructor, not in onLoad event) https://gist.github.com/tbenbrahim/d718ff239e47adc5a5a95d879864f8a4 |
I added a load callback for the time being, that will ensure the table is attached and loaded |
I think the problem is having to know where to put code. I just spent an hour debugging why a row select event handler was not firing, I guess you have to know to call 'addRowSelectHandler` in onLoad and not right after you construct the table. I am trying to get rid of all those cases... This one would be easy, as there is no need to use jQuery events. |
Yep the loading will be reworked to fix those use cases. |
Fixes are in the latest SNAPSHOT and the rc6 |
It looks like the onLoad sets the the boolean setup to true. I think this should probably be moved to the public void setup(TableScaffolding scaffolding) method. The problem I am having is that I am trying to configure the table before it is loaded into the view. The issue is that I am getting a null pointer exception when trying to add the first header. I traced this back to the onLoad method not being called without it being added to the dom. If the boolean isSetup was assigned true in the setup(TableScaffolding scaffolding) method I would be able to call setup with the default table scaffolding and the onload event would not run when the table is loaded but with the logic the way it is. If I call setup and then the onLoad event is called the setup will be called twice.
The text was updated successfully, but these errors were encountered: