From 60f2f4fee6ba55afc6e84d10e17a8594f9f237cb Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 3 Jul 2018 18:21:58 +0200 Subject: [PATCH] * Api: Fix enabled actions don't show up on nm initiation --- api/js/etemplate/et2_dataview_controller.js | 42 +++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/api/js/etemplate/et2_dataview_controller.js b/api/js/etemplate/et2_dataview_controller.js index abaa7ce80f..90a727b268 100644 --- a/api/js/etemplate/et2_dataview_controller.js +++ b/api/js/etemplate/et2_dataview_controller.js @@ -905,27 +905,31 @@ var et2_dataview_controller = (function(){ "use strict"; return Class.extend({ { jQuery(".egwGridView_empty",this._grid.innerTbody).remove(); if(typeof this._grid._rowProvider != "undefined" && this._grid._rowProvider.getPrototype("empty")) - { - var placeholder = this._grid._rowProvider.getPrototype("empty"); - if(jQuery("td",placeholder).length == 1) - { - jQuery("td",placeholder).css("width",this._grid.outerCell.width() + "px") - } - placeholder.appendTo(this._grid.innerTbody); - - // Get the action links if the links callback is set - var links = null; - if (this._linkCallback) + { + var placeholder = this._grid._rowProvider.getPrototype("empty"); + if(jQuery("td",placeholder).length == 1) { - links = this._linkCallback.call( - this._context, - {}, - 0, - "" - ); + jQuery("td",placeholder).css("width",this._grid.outerCell.width() + "px") } - this._selectionMgr.registerRow("",0,placeholder.get(0), links); - } + placeholder.appendTo(this._grid.innerTbody); + + // Register placeholder action only if no rows + if (this._grid._total == 0) + { + // Get the action links if the links callback is set + var links = null; + if (this._linkCallback) + { + links = this._linkCallback.call( + this._context, + {}, + 0, + "" + ); + } + this._selectionMgr.registerRow("",0,placeholder.get(0), links); + } + } }, /**