Yii Framework Forum: CTreeView Sample - Yii Framework Forum

Jump to content

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

CTreeView Sample Rate Topic: -----

#1 User is offline   fuse 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 01-December 08

Posted 01 December 2008 - 03:06 PM

*
POPULAR

Hi,

In the attachment, i've put two samples of use of the component CTreeview ( standard and async).
Hoping it can help someone :)

I'm only not sure about my implementation of the callback in the async part but I didn't saw any other way to return data :

public function actionTreeFill()
{
    [...]
      echo CTreeView::saveDataAsJson($dataTree);
}

Attached File(s)


6

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,896
  • Joined: 04-October 08
  • Location:DC, USA

Posted 01 December 2008 - 03:34 PM

What you did is good. Thanks for the tip.
1

#3 User is offline   meanpenguin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 08-November 08

Posted 02 August 2009 - 06:36 PM

View Postqiang, on 01 December 2008 - 03:34 PM, said:

What you did is good. Thanks for the tip.


This attachment is not available anymore?
0

#4 User is offline   auxbuss 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 164
  • Joined: 14-July 09
  • Location:Malvern, UK

Posted 15 August 2009 - 06:34 AM

<bump>

If someone has this file, could they please attach it here. Thanks.
0

#5 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 15 August 2009 - 03:58 PM

I think it's this one. Had to repack it. I probably just ran it once to find out what it is.

/Tommy

Attached File(s)


Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
3

#6 User is offline   sebi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 06-October 08

Posted 15 August 2009 - 04:13 PM

thank you, very useful!
0

#7 User is offline   auxbuss 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 164
  • Joined: 14-July 09
  • Location:Malvern, UK

Posted 16 August 2009 - 06:41 AM

Brilliant. Thanks a lot.
0

#8 User is offline   auxbuss 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 164
  • Joined: 14-July 09
  • Location:Malvern, UK

Posted 16 August 2009 - 06:47 AM

View Postfuse, on 01 December 2008 - 03:06 PM, said:

I'm only not sure about my implementation of the callback in the async part but I didn't saw any other way to return data :
public function actionTreeFill()
{
     [...]
      echo CTreeView::saveDataAsJson($dataTree);
}


I changed this to:

echo json_encode($dataTree);

0

#9 User is offline   wesleychong 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 31-January 11

Posted 24 March 2011 - 07:50 PM

Thanks man.
0

#10 User is offline   auxbuss 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 164
  • Joined: 14-July 09
  • Location:Malvern, UK

Posted 28 April 2011 - 04:44 AM

I forgot. I put this on github

https://github.com/a...reeView-example
0

#11 User is offline   Sky 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 22-June 11
  • Location:Singapore

Posted 16 October 2011 - 05:46 AM

Thank you so much!
0

#12 User is offline   che 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 12-October 11

Posted 19 October 2011 - 11:23 PM

I have this table:

CREATE TABLE "ADMIN"."ACCOUNT_TYPE_101"
( "ACCOUNT_TYPE_UID" NUMBER PRIMARY KEY,
"ACCOUNT_TYPE_PARENT_UID" NUMBER,
"DESCRIPTION" VARCHAR2(100 BYTE),
)

ALTER TABLE "ADMIN"."ACCOUNT_TYPE_101"
ADD CONSTRAINT "ACCOUNT_TYPE_101_BK__FK1" FOREIGN KEY ("ACCOUNT_TYPE_PARENT_UID")
REFERENCES "ADMIN"."ACCOUNT_TYPE_101" ("ACCOUNT_TYPE_UID") ENABLE



And it has this data:

ACCOUNT_TYPE_UID ACCOUNT_TYPE_PARENT_UID DESCRIPTION
--------------- ----------------------- ------------
1 NULL ASSETS
2 NULL LIABILITIES
3 NULL EQUITY
4 NULL INCOME
5 NULL EXPENSES
6 1 Current Assets
7 6 Cash
....


How can i implement this using CTreeview?

Thanks in advance...
0

#13 User is offline   Legion Commander 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 08-April 14

Posted 03 May 2014 - 10:24 AM

You are an angel. Thanks for the data formatter. You got yourself a friend. :)
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