1

我想将 qtip 与 jqgrid 一起使用,并根据在 jqgrid 中选择的行显示不同的图像。图像的路径可以作为隐藏单元格在 jqgrid 内。我环顾四周,但找不到任何关于 jqgrid 是否有可以使用的相关行选择器的文档。有谁知道我想要的选择器,或者我是否应该尝试完全不同的方法?

到目前为止唯一有效的选择器在下面,但它适用于整个网格。我尝试了一些方法来指定行,但没有任何效果。任何帮助,将不胜感激。

$('#gridtable').qtip({
         content: 'Some text',
         show: 'mouseover',
         hide: 'mouseout',
         position: {
            corner: {
            target: 'topLeft',
            tooltip: 'bottomLeft'
         }
      }
     });
4

1 回答 1

0

我的解决方案是在具有葡萄酒图像的每一行中放置一个图标,并将其分配给该行的 id。这意味着每一行都可以被赋予一个独特的类来悬停。不漂亮,但它的工作。

 if((gridRow['photo'] != "false"))
                {

                $("#gridtable2").jqGrid('setRowData',i+1,{wine:'<div class ="imageicon'+i+'">'+ret['wine']+'  <img src=\"images/icon-wine.png\" height="16" width="13"/></div>'});

                path = '<img src="images/winephotos/'
                + gridRow['id']
                +'.jpg" width="350" height="450" alt="Wine Image"'
                +' class="resize"/>';

                $('.imageicon'+i).qtip({
                    content:  $(path)
                        ,
                        position: {
                             corner: {
                             target: 'topLeft',
                             tooltip: 'bottomLeft'
                          }

                    },
                    show: {
                        when: 'click',
                        //ready: true,
                        solo: true
                    },
                    hide: {
                        when: {
                            event: 'click',
                            event: 'mouseout'
                        }
                    },
                    style: { 
                         width: { max: 280 }, 
                        name: 'dark' 
                     }
                });
                 }
                gridRow=false;
            }
于 2011-02-22T04:39:18.960 回答