diff --git a/index.css b/index.css index 1ed9f499..3122aaa6 100644 --- a/index.css +++ b/index.css @@ -45,16 +45,4 @@ .example-pill-class { font-style: italic; font-weight: bold; -} - -#myRepeater[data-currentview="list.frozen"] table thead tr th, #myRepeater[data-currentview="list.frozen"] .repeater-list-heading { - width: 400px; -} - -#myRepeaterActions table thead tr th, #myRepeaterActions .repeater-list-heading { - width: 400px; -} - -#myRepeaterActions table.table-actions .repeater-list-heading { - width: 100%; } \ No newline at end of file diff --git a/index.js b/index.js index 4b2442cb..2eed628f 100644 --- a/index.js +++ b/index.js @@ -542,12 +542,14 @@ define(function (require) { { label: 'Common Name', property: 'commonName', - sortable: true + sortable: true, + width: 600 }, { label: 'Latin Name', property: 'latinName', - sortable: true + sortable: true, + width: 600 }, { label: 'Appearance', @@ -630,9 +632,7 @@ define(function (require) { dataSource: function (options, callback) { list(options, callback); }, - list_selectable: 'multi', - list_columnSizing:false, - list_columnSyncing: false + list_selectable: 'multi' }, 'thumbnail': { dataSource: function (options, callback) { @@ -646,8 +646,6 @@ define(function (require) { dataSource: function (options, callback) { list(options, callback); }, - list_columnSizing:false, - list_columnSyncing: false, list_selectable: false, // (single | multi) list_frozenColumns: 1 } @@ -750,30 +748,22 @@ define(function (require) { // initialize the repeater var repeaterActions = $('#myRepeaterActions'); repeaterActions.repeater({ - list_columnSizing:false, - list_columnSyncing: false, list_noItemsHTML: 'foo', list_highlightSortedColumn: true, list_actions: { - width: '37px', + width: 37, items: [ { name: 'edit', - html: function () { - return ' Edit' - } + html: ' Edit' }, { name: 'copy', - html: function () { - return ' Copy' - } + html: ' Copy' }, { name: 'delete', - html: function () { - return ' Delete' - }, + html: ' Delete', clickAction: function(helpers, callback) { console.log('hey it worked'); console.log(helpers); @@ -789,7 +779,6 @@ define(function (require) { } initRepeaterActions(); - /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SCHEDULER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ diff --git a/js/repeater-list.js b/js/repeater-list.js index c5f8c1b8..a1d13fbc 100755 --- a/js/repeater-list.js +++ b/js/repeater-list.js @@ -47,7 +47,7 @@ $.fn.repeater.Constructor.prototype.list_getSelectedItems = function () { var selected = []; - this.$canvas.find('.repeater-list table tbody tr.selected').each(function () { + this.$canvas.find('.repeater-list .repeater-list-wrapper > table tbody tr.selected').each(function () { var $item = $(this); selected.push({ data: $item.data('item_data'), @@ -144,11 +144,17 @@ $.fn.repeater.Constructor.prototype.list_setFrozenColumns = function () { var frozenTable = this.$canvas.find('.table-frozen'); + var $wrapper = this.$element.find('.repeater-canvas'); var $table = this.$element.find('.repeater-list .repeater-list-wrapper > table'); var repeaterWrapper = this.$element.find('.repeater-list'); var numFrozenColumns = this.viewOptions.list_frozenColumns; var self = this; + if (this.viewOptions.list_selectable === 'multi') { + numFrozenColumns = numFrozenColumns + 1; + $wrapper.addClass('multi-select-enabled'); + } + if (frozenTable.length < 1) { //setup frozen column markup //main wrapper and remove unneeded columns @@ -170,6 +176,7 @@ this.$element.find('.repeater-list table.table-frozen tr').each(function (i, elem) { $(this).height($table.find('tr:eq(' + i + ')').height()); }); + var columnWidth = $table.find('td:eq(0)').outerWidth(); this.$element.find('.frozen-column-wrapper, .frozen-thead-wrapper').width(columnWidth); @@ -186,7 +193,7 @@ var $wrapper = this.$element.find('.repeater-canvas'); var scrollTop = $wrapper.scrollTop(); var scrollLeft = $wrapper.scrollLeft(); - var frozenEnabled = this.viewOptions.list_frozenColumns; + var frozenEnabled = this.viewOptions.list_frozenColumns || this.viewOptions.list_selectable === 'multi'; var actionsEnabled = this.viewOptions.list_actions; var canvasWidth = this.$element.find('.repeater-canvas').outerWidth(); @@ -234,13 +241,13 @@ for (i = 0, l = this.viewOptions.list_actions.items.length; i < l; i++) { var action = this.viewOptions.list_actions.items[i]; - var html = action.html(); + var html = action.html; - actionsHtml += '
  • ' + html + '
  • '; + actionsHtml += '
  • ' + html + '
  • '; } var selectlist = '
    ' + - '' + '