This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

sfExtJS2Plugin TreePanel

Forum to discuss ExtJS and other JS plugins

sfExtJS2Plugin TreePanel

by drzen » Thu Aug 28, 2008 5:59 pm

Hi,

I'm trying to setup a simple two panel with tree layout.
Here the code:

Code: Select all
<div id='main'></div>

<?php

$sfExtjs2Plugin = new sfExtjs2Plugin(array('theme'=>'blue'));

$private = array();
$public = array();
$sfExtjs2Plugin->load();
$sfExtjs2Plugin->begin();
 
 

// **************************************

// Application

// **************************************


$private['tree']=$sfExtjs2Plugin->TreePanel(array(
           'id'=> 'tree-panel',
          'title'=> 'Sample Layouts',
           'region'=>'north',
           'split'=> true,
           'height'=> 300,
           'root'=> $sfExtjs2Plugin->TreeNode(array(
              'draggable'=>false,
              'text'=>'the root',
               'expanded'=> true,
           ))
        ));
$private['detail']=$sfExtjs2Plugin->Panel(array (
           'region'=>'center',
      'title'=>'Dettagli',
   ));


$private['main']=$sfExtjs2Plugin->Panel(array
    (
      'items' => array('tree','detail'),
            'height' =>350,
            'layout' => 'border',
    ));
 
$public['init'] = $sfExtjs2Plugin->asMethod("
  Ext.QuickTips.init();
  main.render('main');
");
$sfExtjs2Plugin->beginApplication(
  array(
    'name'    => 'Tree',
 
    'private' => $private,
    'public'  => $public
  )
);
$sfExtjs2Plugin->endApplication();
$sfExtjs2Plugin->initApplication('Tree');
$sfExtjs2Plugin->end();

?>




But somethins go wrong. This is relevant generated code:
Code: Select all
<div id='main'></div>

<script type='text/javascript'>

// sfExtjs2Helper: v0.60
Ext.BLANK_IMAGE_URL = '/sfExtjs2Plugin/extjs/resources/images/default/s.gif';
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>plugins/sfExtjs2Plugin/lib/helper/sfExtjs2Helper.php</b> on line <b>765</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>plugins/sfExtjs2Plugin/lib/helper/sfExtjs2Helper.php</b> on line <b>765</b><br />

// application: Tree
var Tree = function () {
var tree = 'new  ()';
var detail = new Ext.Panel ({
region: 'center',
title: 'Dettagli'
});
var main = new Ext.Panel ({
items: [
tree,
detail
],
height: 350,
layout: 'border'
});
return {
 init: function () {
  Ext.QuickTips.init();
  main.render('main');
 }
}}();
Ext.onReady(Tree.init, Tree);
</script>


Any ideas?

Thanks in advance.
v.
drzen
Junior Member
 
Posts: 25
Joined: Thu Mar 13, 2008 5:06 pm
Location: Pordenone - Italy

Re: sfExtJS2Plugin TreePanel

by torsten » Fri Aug 29, 2008 8:07 am

I think you need to replace

Code: Select all
'items' => array('tree','detail'),


with something like

Code: Select all
'items' => array($sfExtjs2Plugin->asVar('tree'),$sfExtjs2Plugin ->('detail')),
torsten
Senior Member
 
Posts: 162
Joined: Sat Nov 25, 2006 11:12 am
Location: Frankfurt/ Germany

Re: sfExtJS2Plugin TreePanel

by drzen » Mon Sep 01, 2008 12:40 pm

No.

The problem is:

Code: Select all
$private['tree']=$sfExtjs2Plugin->TreePanel(array(
           'id'=> 'tree-panel',
          'title'=> 'Sample Layouts',
           'region'=>'east',
           'split'=> true,
           'height'=> 300,
           'root'=> $sfExtjs2Plugin->TreeNode(array(
              'draggable'=>false,
              'text'=>'the root'       
           ))
           
        ));


That create only:

Code: Select all
var tree = 'new  ()';
drzen
Junior Member
 
Posts: 25
Joined: Thu Mar 13, 2008 5:06 pm
Location: Pordenone - Italy

Re: sfExtJS2Plugin TreePanel

by n0ts » Thu Oct 16, 2008 1:06 pm

Hi,

Added following code at plugins/sfExtjs2Plugin/config.php.


sfConfig::set('Ext.tree.AsyncTreeNode',
array(
'class' => 'Ext.tree.AsyncTreeNode',
'attributes' => array()
)
);
sfConfig::set('Ext.tree.TreeNode',
array(
'class' => 'Ext.tree.TreeNode',
'attributes' => array()
)
);
sfConfig::set('Ext.tree.TreeLoader',
array(
'class' => 'Ext.tree.TreeLoader',
'attributes' => array()
)
);
sfConfig::set('Ext.tree.TreePanel',
array(
'class' => 'Ext.tree.TreePanel',
'attributes' => array()
)
);
n0ts
Junior Member
 
Posts: 1
Joined: Thu Oct 16, 2008 1:02 pm