0

所以,我正在尝试用 kendo-kendo 做一个 kendoToolBar。我注意到 k-overflow-wrapper div 被放在 html 的底部,因此溢出项完全脱离了“淘汰”上下文,因此没有任何绑定起作用。

我对如何解决这个问题有点茫然。我不知道以编程方式传输上下文的方法,我试图以编程方式将 k-overflow-wrapper div 移回上下文,这导致整个工具栏由于某种原因消失。我不确定这是否是一个可行的解决方案。

<div id="populationPanelIcons" class="panel-icons" data-bind="kendoToolBar:
                {
                    items: [
                        { id: 'addReportingPopulation', overflow: 'never', type: 'button', spriteCssClass: 'add-button', attributes: { 'title': 'Add Reporting Population', 'data-bind': 'click: addReportingPopulation, css:{ disabled: !auth().canCreate() || isMultiEdit() }, enable: auth().canCreate()' } },
                        { id: 'editReportingPopulation', overflow: 'never', type: 'button', spriteCssClass: 'edit-button', attributes: { 'title': 'Edit Reporting Population', 'data-bind': 'click: editReportingPopulation, css: { disabled: !auth().canUpdate() || isMultiEdit() || isNull(activeItem()) }, enable: auth().canUpdate() && !isNull(activeItem())' } },
                        { id: 'deleteReportingPopulation', overflow: 'never', type: 'button', spriteCssClass: 'delete-button', attributes: { 'title': 'Delete Reporting Population(s)', 'data-bind': 'click: deletePopulation, css: { disabled: !auth().canDelete() || isNull(activeItem())  || !canDelete() }, enable: auth().canDelete() && !isNull(activeItem())' } },
                        { id: 'copyReportingPopulation', overflow: 'always', text: 'Copy ', type: 'button', spriteCssClass: 'copy-button', attributes: { 'title': 'Copy Reporting Population', 'data-bind': 'click: copyReportingPopulation, css: { disabled: !auth().canCreate() || isMultiEdit() || isNull(activeItem()) }, enable: auth().canCreate() && !isNull(activeItem())' } },
                        { id: 'populationRecycleIcon', overflow: 'always', type: 'button', text: 'Recycle', spriteCssClass: 'recycle-button', attributes: { 'title': 'Refreshes all population filters for a project in analytics. (Only needed in certain circumstances)', 'data-bind': 'click: recyclePopulations, css: { disabled: !auth().canUpdate() || isMultiEdit()}, enable: auth().canUpdate()' } },
                        { id: 'importReportingPopulations', overflow: 'always', type: 'button', text: 'Import', spriteCssClass: 'import-all-button',  attributes: { 'title': 'Import Reporting Population', 'data-bind': 'click: importReportingPopulations, css: { disabled: isMultiEdit()}' } },
                        { id: 'exportReportingPopulations', overflow: 'always', type: 'button', text: 'Export',  spriteCssClass: 'export-all-button', attributes: { 'title': 'Export Reporting Population(s)', 'data-bind': 'click: exportReportingPopulations'} }
                    ], overflowOpen: function(e) {
                        window.test(e);
                    }}">
            </div>

self.test = function (e) {

        var toMove = $('.k-overflow-container[data-uid=' + e.sender.uid + ']');         

        if (toMove.length) {
            $(e.sender.element).parent().appendTo(toMove.detach());
        };          

    };
4

0 回答 0