Add min and max row options

Fixed leaking global declaration `rows` in event handler
Use alternate method to get rows to allow shrinking