GridHandler = Class.create(CommonHandler, { //---------------------------------- initialize: function(gridId) { this.gridId = gridId; this.prepareActions(); }, //---------------------------------- afterInitPage: function() { var submitButton = $$('#'+this.gridId+'_massaction-form fieldset span.field-row button'); submitButton.each((function(s) { s.writeAttribute("onclick",''); s.observe('click', (function() { this.massActionSubmitClick(); }).bind(this)); }).bind(this)); }, //---------------------------------- getGridObj: function() { return window[this.gridId + 'JsObject']; }, getGridMassActionObj: function() { return window[this.gridId + '_massactionJsObject']; }, //---------------------------------- getCellContent : function(rowId,cellIndex) { var rows = this.getGridObj().rows; for(var i=0;i]*>(.*?)<\/span>/i); var matches = expr.exec(cellContent); return (matches && !Object.isUndefined(matches[1])) ? matches[1] : ''; }, //---------------------------------- selectAll : function() { this.getGridMassActionObj().selectAll(); }, unselectAll : function() { this.getGridMassActionObj().unselectAll(); }, unselectAllAndReload : function() { this.unselectAll(); this.getGridObj().reload(); }, //---------------------------------- selectByRowId : function(rowId) { this.unselectAll(); var rows = this.getGridObj().rows; for(var i=0;i'+html+'' }); } } var self = this; $('hide_item_help_' + rowId).observe('click', function() { self.hideItemHelp(rowId); }); }, hideItemHelp : function(rowId) { if ($('grid_help_content_'+rowId) != null) { $('grid_help_content_'+rowId).hide(); } $('grid_help_icon_open_'+rowId).show(); $('grid_help_icon_close_'+rowId).hide(); }, //---------------------------------- createHelpTitleHtml : function(rowId) { var productTitle = this.getProductNameByRowId(rowId); var closeHtml = '×'; return '
'+productTitle+''+closeHtml+'
'; }, createHelpActionHtml : function(action) { var self = this; var classContainer = 'hl_container'; if (action.type == 2) { classContainer += ' hl_container_success'; } else if (action.type == 3) { classContainer += ' hl_container_warning'; } else if (action.type == 4) { classContainer += ' hl_container_error'; } var html = '
'; html += '
'+action.date+'
' + '
'; if (action.initiator != '') { html += ''+action.initiator+'  '; } html += ''+action.action+'
' + '
' + '
'; for (var i=0;i'; } else if (action.items[i].type == 3) { type = ''+M2ePro.translator.translate('Warning')+''; } else if (action.items[i].type == 4) { type = ''+M2ePro.translator.translate('Error')+''; } html += '
'+type+'
'+action.items[i].description+'
'; } html += '
' + '
'; return html; }, //---------------------------------- createHelpViewAllLogHtml : function(rowId) { return ''; }, //---------------------------------- getLogViewUrl: function(rowId) { alert('abstract getLogViewUrl'); }, //---------------------------------- prepareActions: function() { alert('abstract prepareActions'); }, //---------------------------------- getComponent: function() { alert('abstract getComponent'); } //---------------------------------- });