https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39715

            Bug ID: 39715
           Summary: Do not quote DataTables options
 Change sponsored?: ---
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Templates
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]

Koha templates are inconsistent when it comes to quoting DataTables options:

(https://gitlab.com/koha-community/Koha/-/blob/main/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt#L221)

var cities_table = $("#table_cities").kohaTable({
    "ajax": {
        "url": cities_table_url
    },
    "order": [[ 1, "asc" ]],
    "columnDefs": [ {
        "targets": [0,1,2,3,4],
        "render": function (data, type, row, meta) {
            if ( type == 'display' ) {
                if ( data != null ) {
                    return data.escapeHtml();
                } else {
                    return "";
                }
            }
            return data;
        }
    } ],

Options in this example like "ajax", "order", and "columnDefs" are quoted in
this example but other templates will have unquoted options. I think we should
standardize on having no quotes around the options. The quotes are unnecessary,
and inconsistent with up-to-date DataTables documentation.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to