HomeHelpTrac

Changeset 15719 for trunk/inc


Ignore:
Timestamp:
12/01/11 01:57:07 (6 months ago)
Author:
Alexander Trofimov
Message:

Grid - automated activation/deactivation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/js/classes/BxDolGrid.js

    r15704 r15719  
    117117} 
    118118 
     119BxDolGrid.prototype.enable = function (sId, isEnable) { 
     120    var e = jQuery('#' + sId); 
     121    if (isEnable) 
     122        e.removeClass('bx-grid-table-row-disabled bx-def-font-grayed'); 
     123    else 
     124        e.addClass('bx-grid-table-row-disabled bx-def-font-grayed'); 
     125} 
     126 
    119127BxDolGrid.prototype._blinkCallback = function (sId) { 
    120128    var e = jQuery('#' + sId); 
     
    208216        } 
    209217    } 
     218    if (oData && undefined != oData.disable) {         
     219        if ('object' == typeof(oData.disable)) { 
     220            for(var i in oData.disable) 
     221                this.enable(this._sObject + '_row_' + oData.disable[i], false); 
     222        } else { 
     223            this.enable(this._sObject + '_row_' + oData.disable, false); 
     224        } 
     225    } 
     226    if (oData && undefined != oData.enable) { 
     227        if ('object' == typeof(oData.enable)) { 
     228            for(var i in oData.enable) 
     229                this.enable(this._sObject + '_row_' + oData.enable[i], true); 
     230        } else { 
     231            this.enable(this._sObject + '_row_' + oData.enable, true); 
     232        } 
     233    } 
    210234    if (oData && undefined != oData.popup) { 
    211235        var sId = 'grid-popup-' + this._sObject + '-' + sAction; 
     
    260284        var sActionData = $(this).attr('bx_grid_action_data'); 
    261285        $this.actionWithId (sActionData, sAction, {}, '', false, sActionConfirm); 
     286    }); 
     287 
     288    jQuery('#' + this._sIdWrapper + ' .bx-switcher-cont input').bind('change', function () { 
     289        var sAction = $(this).attr('bx_grid_action_single'); 
     290        var sActionConfirm = $(this).attr('bx_grid_action_confirm'); 
     291        var sActionData = $(this).attr('bx_grid_action_data'); 
     292        $this.actionWithId (sActionData, sAction, {checked:this.checked ? 1 : 0}, '', false, sActionConfirm); 
    262293    }); 
    263294 
Note: See TracChangeset for help on using the changeset viewer.