HomeHelpTrac

Changeset 15675 for trunk/inc


Ignore:
Timestamp:
11/15/11 22:06:19 (6 months ago)
Author:
Alexander Trofimov
Message:

Grid - design

Location:
trunk/inc
Files:
2 edited

Legend:

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

    r15674 r15675  
    8181        items:'tr',  
    8282        forcePlaceholderSize: true,  
     83 
    8384        start: function(oEvent, oUi) { 
    84             oUi.placeholder.html('<td colspan="2">&rarr;</td>'); 
    85             oUi.item.addClass('bx-grid-gragging-row'); 
     85 
     86            jQuery('#' + $this._sIdTable + ' tbody tr').removeClass('bx-def-color-bg-hl bx-grid-table-row-trans'); // remove rows highlighting and transitions   
     87 
     88            oUi.placeholder.html('<td colspan="' + $this._oOptions.columns + '">&rarr;</td>'); // add placeholder with arrow 
     89         
     90            oUi.item.addClass('bx-grid-gragging-row bx-def-color-bg-active'); // apply classes for dragged row             
    8691        }, 
     92 
    8793        stop: function(oEvent, oUi) { 
    88             oUi.item.removeClass('bx-grid-gragging-row'); 
    89             var s = jQuery('#' + $this._sIdTable + ' tbody').sortable('serialize'); // toArray 
     94            oUi.item.removeClass('bx-grid-gragging-row'); // remove classes from dragged row 
     95             
     96            jQuery('#' + $this._sIdTable + ' tbody tr:odd').addClass('bx-def-color-bg-hl'); // highlight odd rows             
     97 
     98            $this.blink(oUi.item.attr('id')); // make dropped row to blink, so we clearly see where dropped row is places 
     99 
     100            // searialize current rows order and send result to the server for saving 
     101            var s = jQuery('#' + $this._sIdTable + ' tbody').sortable('serialize');  
    90102            $this.action('reorder', {}, s, true); 
    91103        } 
    92104    }); 
     105} 
     106 
     107BxDolGrid.prototype.blink = function (sId) { 
     108    var e = jQuery('#' + sId); 
     109    e.removeClass('bx-grid-table-row-trans'); 
     110    e.addClass('bx-def-color-bg-active');     
     111    setTimeout('glGrids.' + this._sObject + '._blinkCallback("' + sId + '")', 200); 
     112} 
     113 
     114BxDolGrid.prototype._blinkCallback = function (sId) { 
     115    var e = jQuery('#' + sId); 
     116    e.addClass('bx-grid-table-row-trans'); 
     117    e.removeClass('bx-def-color-bg-active'); 
    93118} 
    94119 
     
    234259 
    235260BxDolGrid.prototype._onDataReloaded = function (isSkipSearchInput) { 
     261 
     262    jQuery('#' + this._sIdTable + ' tbody tr:odd').addClass('bx-def-color-bg-hl'); 
     263 
    236264    if (this._oOptions.sorting) 
    237265        this.orderable(); 
     266 
    238267    if (this._oOptions.sortable && 0 == this._sFilter.length && 0 == this._sOrderField.length) 
    239268        this.sortable(); 
     269 
    240270    this._bindActions(isSkipSearchInput); 
    241271} 
  • trunk/inc/utils.inc.php

    r15674 r15675  
    13081308    $sRet = ''; 
    13091309 
    1310     if (is_array($a)) { 
    1311  
    1312         if ($sClasses) { 
    1313             $sClasses = trim($sClasses); 
    1314             $a['class'] = $sClasses . (!empty($a['class']) ? ' ' . $a['class'] : ''); 
    1315         } 
    1316  
    1317         if ($sStyles) { 
    1318             $sStyles = trim($sStyles); 
    1319             if (';' != $sStyles[strlen($sStyles)-1]) 
    1320                 $sStyles .= ';'; 
    1321             $a['style'] = $sStyles . (!empty($a['style']) ? ' ' . $a['style'] : ''); 
    1322         } 
    1323  
    1324         foreach ($a as $sKey => $sValue) { 
    1325  
    1326             if (empty($sValue) || is_null($sValue)) // pass NULL values 
    1327                 continue; 
    1328  
    1329             $sValueC = bx_html_attribute($sValue); 
    1330  
    1331             $sRet .= " $sKey=\"$sValueC\""; 
    1332         } 
    1333     } 
     1310    if (!$a || !is_array($a)) 
     1311        $a = array(); 
     1312 
     1313    if ($sClasses) { 
     1314        $sClasses = trim($sClasses); 
     1315        $a['class'] = $sClasses . (!empty($a['class']) ? ' ' . $a['class'] : ''); 
     1316    } 
     1317 
     1318    if ($sStyles) { 
     1319        $sStyles = trim($sStyles); 
     1320        if (';' != $sStyles[strlen($sStyles)-1]) 
     1321            $sStyles .= ';'; 
     1322        $a['style'] = $sStyles . (!empty($a['style']) ? ' ' . $a['style'] : ''); 
     1323    } 
     1324 
     1325    foreach ($a as $sKey => $sValue) { 
     1326 
     1327        if (empty($sValue) || is_null($sValue)) // pass NULL values 
     1328            continue; 
     1329 
     1330        $sValueC = bx_html_attribute($sValue); 
     1331 
     1332        $sRet .= " $sKey=\"$sValueC\""; 
     1333    } 
     1334 
    13341335 
    13351336    return $sRet; 
Note: See TracChangeset for help on using the changeset viewer.