Add button support for pagination

Fix #5411