CTreeView does not display in View

I created a CTreeView and it does not display although in some view it successfully display.

This are the steps I’ve done:

  1. I created a MODEL and CRUD

  2. I added this code in the aSREFCHARTOFACCOUNT/index.php


$this->widget('CTreeView',array(

			'url' => array('ajaxFillTree')

			)

		);

  1. I added this code in the ASREFCHARTOFACCOUNTcontroller.php

public function actionAjaxFillTree()

	{

if (!Yii::app()->request->isAjaxRequest) {

			exit();

		}

		$parentId = 0;

		if (isset($_GET['root'])) {

			$parentId = (int) $_GET['root'];

		}

		$req = Yii::app()->db->createCommand(

			"SELECT m1.tree_id AS id, m1.tree_name AS TEXT, DECODE(m2.tree_id, NULL, 0, 1) AS hasChildren "

			. "FROM tree m1 "

			. "LEFT JOIN tree m2 ON m1.tree_id = m2.parent_id "

			. "WHERE DECODE(m1.parent_id, NULL, 0, m1.parent_id) = $parentId "

			. "GROUP BY m1.tree_id, m1.tree_name, DECODE(m2.tree_id, NULL, 0, 1) "

			. "ORDER BY m1.tree_name ASC "

		);

		

		$children = $req->queryAll();

		echo str_replace(

			'"hasChildren":"0"',

			'"hasChildren":false',

			CTreeView::saveDataAsJson($children)

		);

		exit();

}

I used this in the site/index.php(view) and SiteController.php(controller) and it displayed successfully, i don’t know why it does not display when I used the CRUD.

Any help? Thanks in advance.

^^,