Yii Framework Forum: Tooltip In Grid View - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Tooltip In Grid View Rate Topic: -----

#1 User is offline   n-r 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 222
  • Joined: 19-April 13

Posted 13 March 2014 - 03:31 AM

hi
i want to put on tooltip in gridview
my code
protected/view/myshow/admin
<link rel="stylesheet" type="text/css" href="http://craigsworks.com/projects/qtip2/packages/latest/jquery.qtip.min.css" />
<script type="text/javascript" src="http://craigsworks.com/projects/qtip2/packages/latest/jquery.qtip.min.js"></script>
<script>
$(document).ready(function()
{
    toolt_tip();
});
 
function toolt_tip(){
    $('.tool_tip').each(function() { 
        $(this).qtip({
            content:{
                text: '456456',
                ajax: {
                    // Use the rel attribute of each element for the url to load
                    url: $(this).attr('rel')
                },
                title: {
                    // Give the tooltip a title using each elements text
                    text: 'Ticket - ' + $(this).text(), 
                    button: true
                }
            },
            position: {
                at: 'bottom center', 
                my: 'top center',
                viewport: $(window), 
                effect: false 
            },
            show: {
                event: 'click',
                solo: true 
            },
            hide: 'unfocus',
            style: {
                classes: 'qtip-wiki qtip-light qtip-shadow'
            }
        })
    })
    .click(function(event) { event.preventDefault(); });
}



</script>



<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'alonavid-result-grid',
	'dataProvider'=>$model->search(),
	
	'filter'=>$model,
	'columns'=>array(
	 array('header'=>Yii::t('fieldName','ID'),
          'class'=>'IndexColumn',),
		
		'time',
            array(
                'name'=>'first',
				'header'=>'first',
                    'type' => 'raw',
   'value' => 'CHtml::link($data->getIdcoller1(),
        CHtml::normalizeUrl("javascript:void(0)"),
        array(
            "id" => "'.rand(0,999999).'",
            "rel" => "Viewamount?even_id={$data["id"]}&cdr_id= {$data["first"]}",
            "class" => "tool_tip",
        )
    )',

        
            
                ),
            array(
                'name'=>'second',
                'value'=>'$data->getIdcoller2()',
				'htmlOptions'=>array('class'=>'sdf777')
                ),
         
		
		
		array(
			'class'=>'CButtonColumn',
                    'template'=>'',
		),
	),
)); ?>




and action in controller is right.
in first , tooltip is worked, but after update grid with ajax , tooltip not work !!
plz help me. thanks
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users