Search code examples
atk4

Atk4 and popup from examples


im trying to get to work simple pop-up, form the examples, but none is working..

Using 4.3.0.dev.

Tried from here: http://book.agiletoolkit.org/views/popover.html

$i = $this->add('Icon')->set('window');
$pop = $this->add('View_Popover');
$pop->add('HelloWorld');
$i->js('click', $pop->showJS());

Or from here: http://www4.agiletoolkit.org/css/popover

//The view to click (can be any element)
$view = $this->add('View')->set('Some text');
//Popover view
$pop = $this->owner->add('View_Popover');
$pop->add('View')->set('Content to show in tooltip');
$this->on('click','#'.$view->name,$pop->showJS($this->js(null, '$(this)'),array(
    'width'=>'250px',//You can specify the width of tooltip
    'my'=>'left bottom',//Specify the position of the tooltip
    'at'=>'left+5 bottom-25',//Specify the margins
    'class' => 'atk-popover atk-popover-bottom-left',//Specify where to show
)));

On both examples i get js error:

Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'  jquery-2.0.3.min.js:4

Solution

  • I don't know what happened yesterday, maybe i was too tired, but it's working now..