- Timestamp:
- 11/15/11 22:06:19 (6 months ago)
- Location:
- trunk/inc
- Files:
-
- 2 edited
-
js/classes/BxDolGrid.js (modified) (2 diffs)
-
utils.inc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/js/classes/BxDolGrid.js
r15674 r15675 81 81 items:'tr', 82 82 forcePlaceholderSize: true, 83 83 84 start: function(oEvent, oUi) { 84 oUi.placeholder.html('<td colspan="2">→</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 + '">→</td>'); // add placeholder with arrow 89 90 oUi.item.addClass('bx-grid-gragging-row bx-def-color-bg-active'); // apply classes for dragged row 86 91 }, 92 87 93 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'); 90 102 $this.action('reorder', {}, s, true); 91 103 } 92 104 }); 105 } 106 107 BxDolGrid.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 114 BxDolGrid.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'); 93 118 } 94 119 … … 234 259 235 260 BxDolGrid.prototype._onDataReloaded = function (isSkipSearchInput) { 261 262 jQuery('#' + this._sIdTable + ' tbody tr:odd').addClass('bx-def-color-bg-hl'); 263 236 264 if (this._oOptions.sorting) 237 265 this.orderable(); 266 238 267 if (this._oOptions.sortable && 0 == this._sFilter.length && 0 == this._sOrderField.length) 239 268 this.sortable(); 269 240 270 this._bindActions(isSkipSearchInput); 241 271 } -
trunk/inc/utils.inc.php
r15674 r15675 1308 1308 $sRet = ''; 1309 1309 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 1334 1335 1335 1336 return $sRet;
Note: See TracChangeset
for help on using the changeset viewer.