diff --git a/smash/web/static/js/smash.js b/smash/web/static/js/smash.js index 9ae0968b16a23e70ce3aaf30d866b866c5dc9d58..2f2846523db2447089e98c1c7f08de6accf1aff3 100644 --- a/smash/web/static/js/smash.js +++ b/smash/web/static/js/smash.js @@ -128,7 +128,20 @@ function getColumns(columns, getSubjectEditUrl) { var result = []; for (var i = 0; i < columns.length; i++) { var columnRow = columns[i]; - if (columnRow.type === "edit") { + if (columnRow.type === "address"){ + + var renderFunction = (function () { + return function (data, type, row) { + return data; + }; + })(); + + var columnDef = createColumn(columnRow.type, columnRow.name, columnRow.filter, columnRow.visible, columnRow.sortable, renderFunction); + columnDef.className = 'subject-address'; + columnDef.width = '150px'; + result.push(columnDef); + + } else if (columnRow.type === "edit") { result.push(createColumn("id", columnRow.name, columnRow.filter, columnRow.visible, columnRow.sortable, function (data, type, row) { var url = getSubjectEditUrl(row.id.toString()); @@ -392,7 +405,6 @@ function createTable(params) { }); }); - $(function () { var columns = []; var columnDefs = []; @@ -403,6 +415,8 @@ function createTable(params) { "targets": i, "render": column.render, visible: column.visible, + className: column.className, + width: column.width, orderable: column.sortable }); } @@ -450,7 +464,7 @@ function createTable(params) { }); $('#table_filter').css("display", "null"); }); - $('#visible-column-checkboxes input').on('click', function (e) { + $(params.checkboxesElement).find('input').on('click', function (e) { var visible = $(this).is(":checked"); // Get the column API object