繁体   English   中英

分页后qtip2工具提示不起作用(Jquery Datatables)

[英]qtip2 tooltip is not working after pagination (Jquery Datatables)

初始化dataTables:

$('#example').dataTable({ data: data, columns: columns });

初始化dataTables im设置工具提示后:

$(".showInfo").qtip({                   
                    content: {text: function(event, api) {                            
                                $.get( "url", function(result) {                                                                   
                                    var content = 'Name :' + result.Name + '</br>';
                                        content += 'Phone :' + result.Phone+ '</br>';
                                        content += 'Phone :' + result.Email+ '</br>';                                        
                                    api.set('content.text', content);
                                }), function(xhr, status, error) {
                                    api.set('content.text', status + ': ' + error);
                                };
                                return 'Loading...' 
                                }
                            }
                });

上面的代码适用于dataTable的第一页。 但是当我分页时,“ qtip”功能不起作用。 请帮我。

我知道了 :)

$('#example').on('mouseenter', '.showInfo', function(event) {

                            $.get("URL", function(result) {
                                $(this).qtip({
                                    overwrite: false,
                                    content: function() {

                                        var content = 'Name :' + result.Name + '</br>';
                                        content += 'Phone :' + result.Phone + '</br>';
                                        content += 'Phone :' + result.Email + '</br>';
                                        return content;
                                    },
                                    show: {
                                        event: event.type,
                                        ready: true
                                    },
                                    hide: {
                                        fixed: true
                                    }
                                }, event); 
                            }, 'json');
                        });

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM