Ignore:
Timestamp:
2009/03/05 18:59:38 (15 years ago)
Author:
theuri
Message:

テーブルの特定セルのみをD&Dできるようにし、従来の機能と共存できるように改良したバージョンを実装。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/Smarty/templates/default/admin/products/category.tpl

    r17612 r17870  
    2626<input type="hidden" name="parent_category_id" value="<!--{$arrForm.parent_category_id}-->"> 
    2727<input type="hidden" name="category_id" value="<!--{$arrForm.category_id}-->"> 
     28<input type="hidden" name="keySet" value=""> 
    2829<div id="products" class="contents-main"> 
    2930  <h2>カテゴリー設定(最大<!--{$smarty.const.LEVEL_MAX}-->階層まで)</h2> 
     
    8990     
    9091    <!--{if count($arrList) > 0}--> 
    91     <table class="list"> 
    92       <tr> 
     92<script type="text/javascript"> 
     93// カテゴリーテーブルのイニシャライズ 
     94$(document).ready(function() { 
     95    $("#categoryTable").tableDnD({ 
     96        onDragClass: "movingHandle", 
     97        onDrop: function(table, row) { 
     98            var rows = table.tBodies[0].rows; 
     99            var keys = row.id; 
     100 
     101            for (var i = 0; i < rows.length; i++) { 
     102                if (row.id == rows[i].id) { 
     103                    keys += "-" + i; 
     104                    break; 
     105                } 
     106            } 
     107 
     108            fnModeSubmit('moveByDnD','keySet', keys); 
     109        }, 
     110        dragHandle: "dragHandle" 
     111    }); 
     112 
     113    $("#categoryTable tr").hover(function() { 
     114        $(this.cells[0]).addClass('activeHandle'); 
     115    }, function() { 
     116        $(this.cells[0]).removeClass('activeHandle'); 
     117    }); 
     118}); 
     119</script> 
     120    <table class="list" id="categoryTable"> 
     121      <tr class="nodrop nodrag"> 
     122        <th width="40">移動</th> 
    93123        <th>ID</th> 
    94124        <th>カテゴリ名</th> 
     
    98128      </tr> 
    99129      <!--{section name=cnt loop=$arrList}--> 
    100       <tr style="background:<!--{if $arrForm.category_id != $arrList[cnt].category_id}-->#ffffff<!--{else}--><!--{$smarty.const.SELECT_RGB}--><!--{/if}-->;" align="left"> 
    101         <td class="center"><!--{$arrList[cnt].category_id}--></td> 
     130      <tr id="<!--{$arrList[cnt].category_id}-->" style="background:<!--{if $arrForm.category_id != $arrList[cnt].category_id}-->#ffffff<!--{else}--><!--{$smarty.const.SELECT_RGB}--><!--{/if}-->;" align="left"> 
     131        <td class="dragHandle">&sect;</td> 
     132        <td class="center"><!--{$arrList[cnt].category_id}--></td> 
    102133        <td> 
    103134        <!--{if $arrList[cnt].level != $smarty.const.LEVEL_MAX}--> 
Note: See TracChangeset for help on using the changeset viewer.