- Timestamp:
- 01/06/12 01:08:35 (5 months ago)
- File:
-
- 1 edited
-
trunk/inc/js/classes/BxDolGrid.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/js/classes/BxDolGrid.js
r15803 r15841 120 120 BxDolGrid.prototype.enable = function (sId, isEnable) { 121 121 var e = jQuery('#' + sId); 122 if (isEnable) 122 if (isEnable) { 123 this._bindActionsSingle(e); 123 124 e.removeClass('bx-grid-table-row-disabled bx-def-font-grayed'); 124 else 125 e.find('*[bx_grid_action_single]').removeClass('bx-btn-disabled'); 126 } else { 127 e.find('*[bx_grid_action_single]').addClass('bx-btn-disabled'); 125 128 e.addClass('bx-grid-table-row-disabled bx-def-font-grayed'); 129 this._unbindActionsSingle(e); 130 } 126 131 } 127 132 … … 278 283 } 279 284 285 BxDolGrid.prototype._unbindActionsSingle = function (eElement) { 286 var elements; 287 288 if ('undefined' == typeof(eElement)) 289 elements = jQuery('#' + this._sIdWrapper + ' *[bx_grid_action_single]'); 290 else 291 elements = eElement.find('*[bx_grid_action_single]'); 292 293 elements.unbind('click'); 294 } 295 296 BxDolGrid.prototype._bindActionsSingle = function (eElement) { 297 var $this = this; 298 var elements; 299 300 if ('undefined' == typeof(eElement)) 301 elements = jQuery('#' + this._sIdWrapper + ' *[bx_grid_action_single]'); 302 else 303 elements = eElement.find('*[bx_grid_action_single]'); 304 console.log(elements.size()) 305 306 elements.bind('click', function () { 307 if ($(this).hasClass('bx-btn-disabled')) 308 return; 309 var sAction = $(this).attr('bx_grid_action_single'); 310 var sActionConfirm = $(this).attr('bx_grid_action_confirm'); 311 var sActionData = $(this).attr('bx_grid_action_data'); 312 $this.actionWithId (sActionData, sAction, {}, '', false, sActionConfirm); 313 }); 314 315 } 316 280 317 BxDolGrid.prototype._bindActions = function (isSkipSearchInput) { 281 318 var $this = this; … … 290 327 }); 291 328 292 jQuery('#' + this._sIdWrapper + ' *[bx_grid_action_single]').bind('click', function () { 293 if ($(this).hasClass('bx-btn-disabled')) 294 return; 295 var sAction = $(this).attr('bx_grid_action_single'); 296 var sActionConfirm = $(this).attr('bx_grid_action_confirm'); 297 var sActionData = $(this).attr('bx_grid_action_data'); 298 $this.actionWithId (sActionData, sAction, {}, '', false, sActionConfirm); 299 }); 329 this._bindActionsSingle (); 300 330 301 331 if (jQuery('#' + this._sIdWrapper + ' .bx-switcher-cont input').length)
Note: See TracChangeset
for help on using the changeset viewer.