Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I want to add headers to this table. But it does not work. I'm sure I'm doing something wrong. :)
function my_module_rates_page(provider) {
try {
var header = [];
header.push({ data: 'Country' });
header.push({ data: 'Landline' });
header.push({ data: 'Mobile' });
header.push({ data: 'SMS' });
var content = {};
content['my_rates_list'] = {
theme: 'view',
header: header,
format: 'table',
pager_pos: 'bottom',
format_attributes: {
border: 0,
},
path: 'mobile/rate/'+provider, /* the path to the view in Drupal */
row_callback: 'my_module_rates_list_row',
empty_callback: 'my_module_rates_list_empty',
attributes: {
id: 'my_rates_list_view'+provider
}
};
return content;
}
catch (error) { console.log('my_module_rates_page - ' + error); }
}
Comments
Comment #1
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedTable headers are only supported when making a table render array, I don't think they work when using a view render array as a table. The improvements will have to happen somewhere around here: https://github.com/signalpoint/DrupalGap/blob/7.x-1.x/src/modules/views/...
Comment #2
coolman7 CreditAttribution: coolman7 commentedI implemented with manually created tables as explained here:
http://drupalgap.org/node/237
It worked but all cells and headers aligned left. I don't figure out how to align text in cells and headers right or center?
Thanks
Comment #3
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedYou'll have to use CSS for now as the table system isn't flexible enough. Or you can contribute to the table system and make this flexibility a reality ;)
Comment #4
coolman7 CreditAttribution: coolman7 commentedOk. I decided to contribute and make some changes in core with fork of github repository. I have some problems while forking and compiling. I've just opened an issue at github.
Thanks