HomeHelpTrac

Changeset 15711 for trunk/templates


Ignore:
Timestamp:
11/29/11 00:03:24 (6 months ago)
Author:
Alexander Trofimov
Message:

Grid

Location:
trunk/templates/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/base/css/default.css

    r15675 r15711  
    105105 
    106106.bx-def-color-bg-hl { 
    107     background-color: #f8f8ff; 
     107    background-color: rgba(200, 200, 255, 0.2); 
    108108} 
    109109 
    110110.bx-def-color-bg-active { 
    111111    background-color: #ffbb33; 
     112} 
     113 
     114/* hr */ 
     115 
     116.bx-def-hr { 
     117    margin-left:0; 
     118    margin-right:0; 
     119    padding:0; 
     120    border:none; 
     121    border-top:1px solid #dddddd; 
     122    border-bottom:1px solid #ffffff; 
     123    border-top:1px solid rgba(200, 200, 200, 0.5); 
     124    border-bottom:1px solid rgba(255, 255, 255, 0.8); 
    112125} 
    113126 
  • trunk/templates/base/css/grid.css

    r15704 r15711  
    55} 
    66 
     7.bx-grid-table-wrapper .bx-def-hr { 
     8    margin:0; 
     9} 
     10 
     11.bx-grid-table .bx-grid-table-row-hr td:first-child, 
     12.bx-grid-table .bx-grid-table-row-hr td { 
     13    padding:0; 
     14} 
    715 
    816.bx-grid-table-row-trans { 
     
    1119   -o-transition:background-color 1s linear; 
    1220   transition:background-color 1s linear; 
     21} 
     22 
     23.bx-grid-table .bx-grid-table-row-empty td { 
     24    text-align:center; 
    1325} 
    1426 
  • trunk/templates/base/grid.html

    r15704 r15711  
    2121    </bx_if:display_header> 
    2222 
    23     <div id="__id_cont__"> 
     23    <div id="__id_cont__" class="bx-grid-table-wrapper bx-def-margin-top"> 
     24         
     25        <hr class="bx-def-hr" /> 
    2426 
    25         <table id="__id_table__" class="bx-grid-table bx-def-margin-bottom bx-def-margin-top"> 
    26             <thead class="bx-def-border-bottom bx-def-border-top"> 
     27        <table id="__id_table__" class="bx-grid-table"> 
     28            <thead> 
    2729                <tr> 
    2830                    <bx_repeat:row_header> 
     
    3032                    </bx_repeat:row_header> 
    3133                </tr> 
    32             </thead> 
    33             <tbody class="bx-def-border-bottom"> 
     34                <tr class="bx-grid-table-row-hr"> 
     35                    <td colspan="__columns__"><hr class="bx-def-hr" /></td> 
     36                </tr> 
     37            </thead>             
     38            <tbody> 
    3439                    <bx_repeat:rows_data> 
    3540                        <tr id="__id_row__" class="__row_class__"> 
     
    4045        </table> 
    4146 
    42         <div class="bx-grid-footer bx-def-margin-bottom"> 
     47        <hr class="bx-def-hr" /> 
     48 
     49        <div class="bx-grid-footer bx-def-margin-bottom bx-def-margin-sec-top"> 
    4350            <bx_if:actions_bulk> 
    4451                <div style="float:left;"> 
  • trunk/templates/base/scripts/BxBaseGrid.php

    r15706 r15711  
    256256    protected function _getRowsDataDesign (&$aData) { 
    257257        $aGrid = array(); 
    258         foreach ($aData as $aRow) { 
    259             $sRow = ''; 
    260             foreach ($this->_aOptions['fields'] as $sKey => $aField) 
    261                 $sRow .= $this->_getCellDesign($sKey, $aField, $aRow); 
    262             $aGrid[] = array('row' => $sRow, 'id_row' => $this->_sObject . '_row_' . $aRow[$this->_aOptions['field_id']], 'row_class' => $this->_isRowDisabled($aRow) ? 'bx-grid-row-disabled bx-def-font-grayed' : ''); 
    263         }             
     258        if (empty($aData)) { 
     259 
     260            $aGrid[] = array( 
     261                'row' => '<td class="bx-def-padding-sec-bottom bx-def-padding-sec-top" colspan="' . count($this->_aOptions['fields']) . '">' . _t('_Empty') . '</td>',  
     262                'id_row' => 0,  
     263                'row_class' => 'bx-grid-table-row-empty', 
     264            ); 
     265 
     266        } else { 
     267 
     268            foreach ($aData as $aRow) { 
     269                $sRow = ''; 
     270                foreach ($this->_aOptions['fields'] as $sKey => $aField) 
     271                    $sRow .= $this->_getCellDesign($sKey, $aField, $aRow); 
     272 
     273                $aGrid[] = array( 
     274                    'row' => $sRow,  
     275                    'id_row' => $this->_sObject . '_row_' . $aRow[$this->_aOptions['field_id']],  
     276                    'row_class' => $this->_isRowDisabled($aRow) ? 'bx-grid-table-row-disabled bx-def-font-grayed' : '', 
     277                ); 
     278            } 
     279        }  
    264280        return $aGrid; 
    265281    } 
     
    306322            isset($aField['width']) ? 'width:' . $aField['width'] : false  // add default styles 
    307323        ); 
    308         return '<td ' . $sAttr . '>' . $this->_getActions('single', $aRow[$this->_aOptions['field_id']], true, $this->_isRowDisabled($aRow)) . '</td>'; 
     324        return '<td ' . $sAttr . '>' . $this->_getActions('single', $aRow[$this->_aOptions['field_id']], true, $this->_isRowDisabled($aRow), $aRow) . '</td>'; 
    309325    } 
    310326 
     
    319335     
    320336 
    321     protected function _getActions ($sType, $sActionData = false, $isSmall = false, $isDisabled = false) { 
     337    protected function _getActions ($sType, $sActionData = false, $isSmall = false, $isDisabled = false, $aRow = array()) { 
    322338        $sActionsType = 'actions_' . $sType; 
    323339        if (empty($this->_aOptions[$sActionsType]) || !is_array($this->_aOptions[$sActionsType])) 
     
    335351                    $a['attr']['bx_grid_action_confirm'] = $a['confirm'] ? 1 : 0; 
    336352            } 
    337             $sRet .= $this->$sFunc($sType, $sKey, $a, $isSmall, $isDisabled); 
     353            $sRet .= $this->$sFunc($sType, $sKey, $a, $isSmall, $isDisabled, $aRow); 
    338354        } 
    339355        return $sRet; 
    340356    } 
    341357     
    342     protected function _getActionDefault ($sType, $sKey, $a, $isSmall = false, $isDisabled = false) { 
     358    protected function _getActionDefault ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array()) { 
    343359        $sAttr = $this->_convertAttrs( 
    344360            $a, 'attr', 
     
    348364    } 
    349365 
    350     protected function _getActionDivider ($sType, $sKey, $a, $isSmall = false, $isDisabled = false) { 
     366    protected function _getActionDivider ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array()) { 
    351367        return '<div class="bx-grid-actions-divider bx-def-margin-sec-left"> | </div>'; 
    352368    } 
Note: See TracChangeset for help on using the changeset viewer.