1

There is no such option as change the prev and next button label in the documentation, and when i try to use string replacement or change the button innerHTML via Javascript, it doesn't work, is there any way that I can safely change the label?

4

1 回答 1

1

You can use the language config (added since v1.5.0) to customize this:

new Grid({
  columns: ['Name', 'Email', 'Title'],
  sort: true,
  search: true,
  pagination: {
    limit: 5
  },
  data: Array(50).fill().map(x => [
    faker.name.findName(),
    faker.internet.email(),
    faker.name.title(),
  ]),
  language: {
    'search': {
      'placeholder': ' Search...'
    },
    'pagination': {
      'previous': '⬅️',
      'next': '➡️',
      'showing': ' Displaying'
    }
  }
});

Also see this example: https://gridjs.io/docs/examples/i18n/

于 2020-06-14T14:29:48.217 回答