The current default pager in Views Paging Drupalgap is easily neglected.
Can I assign it a new icon or create my own pager button? Currently, what I know is to put it at the top or the bottom using pager_pos: 'bottom'
, but nothing else.
The current default pager in Views Paging Drupalgap is easily neglected.
Can I assign it a new icon or create my own pager button? Currently, what I know is to put it at the top or the bottom using pager_pos: 'bottom'
, but nothing else.
Thanks to Tyler. I follow his suggestion and have solved this by adding the theme_pager_link() to app/themes/my_theme/my_theme.js
. Here is what I added:
function my_theme_pager_next(variables) {
try {
var html;
variables.page = parseInt(variables.results.view.page) + 1;
var link_vars = {
text: 'Next Page',
attributes: {
'class': 'pager_next',
'data-icon': 'fast-forward'
}
};
html = theme_pager_link(variables, link_vars);
return html;
}
catch (error) { console.log('my_theme_pager_next - ' + error); }
}
function my_theme_pager_previous(variables) {
try {
var html;
variables.page = parseInt(variables.results.view.page) - 1;
var link_vars = {
text: 'Previous Page',
attributes: {
'class': 'pager_previous',
'data-icon': 'fast-backward'
}
};
html = theme_pager_link(variables, link_vars);
return html;
}
catch (error) { console.log('my_theme_pager_previous - ' + error); }
}
theme_pager_link()
function in your theme? api.drupalgap.org/7/global.html#theme_pager_link - For example, implement:my_theme_pager_link()
theme_pager_next
the text istext: '»',
. Do you mean I modify that insrc/modules/views/views.js
?bin/drupalgap.min.js
and it works, but it seems not very appropriate to change this file. Is there a place I can put my custom theme_pager?theme_pager_link()
, and then create a new function calledmy_theme_pager_link()
in your theme's .js file, then when it comes time to render, DrupalGap we'll see if the active theme is overriding that particular theme function, then it'll use that instead of the core one. That way you don't have to modify core.'data-position': 'b'
, it should be'data-theme': 'b'
.