2012-04-15 29 views

答えて

7

appendToの代わりにprependToを使用しようとしましたが、すべて動作します。丁度私がホバリングの小さな改善のためのCSS

.ui-inline-custom.ui-state-hover span { margin: -1px; } 

が既に実装さthe bug fixに対応さらに追加対応demoディスプレイ

enter image description here

loadComplete: function() { 
    var iCol = getColumnIndexByName(grid, 'act'); 
    $(this).find(">tbody>tr.jqgrow>td:nth-child(" + (iCol + 1) + ")") 
     .each(function() { 
      $("<div>", { 
       title: "Custom", 
       mouseover: function() { 
        $(this).addClass('ui-state-hover'); 
       }, 
       mouseout: function() { 
        $(this).removeClass('ui-state-hover'); 
       }, 
       click: function(e) { 
        alert("'Custom' button is clicked in the rowis="+ 
         $(e.target).closest("tr.jqgrow").attr("id") +" !"); 
       } 
      } 
     ).css({"margin-right": "5px", float: "left", cursor: "pointer"}) 
      .addClass("ui-pg-div ui-inline-custom") 
      .append('<span class="ui-icon ui-icon-document"></span>') 
      .prependTo($(this).children("div")); 
    }); 
} 

を使用しますjqGrid 4.3.2。

更新:free jqGridの最新バージョンは、カスタムボタンを実装する簡単な方法をサポートしています。 the demoを参照してください。

関連する問題