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

feature: onCreateRow onCreateCol #122

Closed

Conversation

jayden-arrai
Copy link

Created onCreateRow and onCreateCol which are called when a row is
created and column created respectively.

Created onCreateRow and onCreateCol which are called when a row is
created and column created respectively.
@jayden-arrai
Copy link
Author

If you want to change the arguments that get passed to the onCreateRow and onCreateCol functions please feel free to do so. In what I am using these for I am not using any arguments so I just tried to figure out what might be useful to people.

@warpech
Copy link
Member

warpech commented Sep 9, 2012

I am not familiar with the notation to send callback object instead of a function. Is this your idea or you have experience with it from other projects?

I understand the reason but I think I would prefer to remove it to keep the code simple and understandable to broad audience.

@jayden-arrai
Copy link
Author

I'm actually used to using Yui2 where you can create events which can be subscribed to. Each thing you subscribe can have its own scope.

The reason I did called it like this:
priv.settings.onCreateRow.call(this, data)

Is because that way this in the function it calls is the handsontable. As I mentioned I don't actually need it to do this. I'm not using any of the data I'm passing to it. I'm just using the function to know that the size of the handsontable has changed so I can switch it into a scrolling handsontable if it gets past a certain point.

@warpech
Copy link
Member

warpech commented Sep 10, 2012

I see. I will think about it...

Another question - would you mind if I merge those callbacks into one
onAlter? It would be consistent because the method to create/remove
rows/cols is the same. This callback would have a param saying what was the
actual action
10 wrz 2012 17:46, "Jayden Kneller" notifications@github.com napisał(a):

I'm actually used to using Yui2 where you can create events which can be
subscribed to. Each thing you subscribe can have its own scope.

The reason I did called it like this:
priv.settings.onCreateRow.call(this, data)

Is because that way this in the function it calls is the handsontable. As
I mentioned I don't actually need it to do this. I'm not using any of the
data I'm passing to it. I'm just using the function to know that the size
of the handsontable has changed so I can switch it into a scrolling
handsontable if it gets past a certain point.


Reply to this email directly or view it on GitHubhttps://github.com//pull/122#issuecomment-8427248.

@jayden-arrai
Copy link
Author

Go ahead. This change is easy for me to do in my code. Feel free to make any changes you'd like to my code.

@deeta
Copy link

deeta commented Sep 24, 2012

I am looking for this feature to limit the max rows that can be created. Is there any other way to accomplish this with the current release?
Thanks

@setthase setthase mentioned this pull request Apr 22, 2013
@warpech
Copy link
Member

warpech commented May 7, 2013

Thanks for your patience guys! We could not merge the pull request because we were working on a more complex solution for the events and callbacks. Now it is ready.

Handsontable 0.9.0-beta1 adds new callbacks afterCreateRow and afterCreateCol. You are welcome to test it. Until it is merged with master branch, you will need to checkout 0.9 branch

More about new Events.

I will close this ticket when branch 0.9 is merged with master. Thanks again!

@warpech
Copy link
Member

warpech commented May 21, 2013

Handsontable 0.9.0 now features the afterCreateRow and afterCreateCol callbacks. Thanks for your pioneering work on this and once again sorry that I was not able to merge this because of the major rewrite.

More about new events here: https://github.com/warpech/jquery-handsontable/wiki/Events

@warpech warpech closed this May 21, 2013
budnix pushed a commit that referenced this pull request Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants