MT#3961 using specific identifier for datatables table

to avoid getting our id from the translated name, because that would probably
contain unicode, which is not a problem in HTML5 or higher, but below.
be careful to create a different identifier for each datatable you create
in a template, othewise the previous one would be used, and uniqueness is gone!
gjungwirth/test_sleeps
Gerhard Jungwirth 12 years ago
parent 9040831ecd
commit f1a210fafb

@ -1,6 +1,7 @@
[% site_config.title = c.loc('Administrators') -%]
[%
helper.name = c.loc('Administrator');
helper.identifier = 'administrator';
helper.show_create_button = 1;
helper.data = admins;
helper.messages = messages;

@ -2,6 +2,7 @@
[%
helper.name = c.loc('Billing Fee');
helper.identifier = 'billing_fee';
helper.messages = messages;
helper.dt_columns = fee_dt_columns;
helper.length_change = 1;

@ -1,6 +1,7 @@
[% site_config.title = c.loc('Billing Profiles') -%]
[%
helper.name = c.loc('Billing Profile');
helper.identifier = 'billing_profile';
helper.messages = messages;
helper.dt_columns = profile_dt_columns;
helper.length_change = 1;

@ -54,6 +54,7 @@
[%
helper.name = c.loc('Date Definition');
helper.identifier = 'date_definition';
helper.dt_columns = special_dt_columns;
helper.create_flag = peaktimes_special_createflag;

@ -1,6 +1,7 @@
[% site_config.title = c.loc('Billing Zones') -%]
[%
helper.name = c.loc('Billing Zone');
helper.identifier = 'billing_zone';
helper.messages = messages;
helper.dt_columns = zone_dt_columns;
helper.length_change = 1;

@ -1,6 +1,7 @@
[% site_config.title = c.loc('Contacts') -%]
[%
helper.name = c.loc('Contact');
helper.identifier = 'contact';
helper.data = contacts;
helper.messages = messages;
helper.dt_columns = contact_dt_columns;

@ -11,7 +11,8 @@
backuri = c.req.uri;
tmp = backuri.query_param_delete('back');
# create unique identifier
helper.id_from_name = helper.name.remove('[\s+\.#]');
helper.id_from_name = helper.identifier || helper.name.remove('[\s+\.#]');
helper.identifier = 0; # make sure we dont use the same identifier twice
-%]
<script src="/js/libs/bootstrap/datatables-paging.js"></script>

Loading…
Cancel
Save