i attached my App at this link :
http://www.ziddu.com/download/10731772/CategoryApp.rar.html

On Jul 16, 9:45 am, Cruisine <[email protected]> wrote:
> IT WORKS...thanks CRICKET
>
> On Jul 15, 10:20 pm, cricket <[email protected]> wrote:
>
> > On Thu, Jul 15, 2010 at 5:27 AM, Badieah <[email protected]> wrote:
> > > hi,i'm still newbie in cakePHP
> > > i have a problem to populate my data into combobox.
> > > i have one table named Category which have function to manage account
> > > (in finance) and sub account..
> > > the logic are account have many sub account, sub account have many
> > > child..the field of the table represented in followings :
> > > id                  ------->id of the account data
> > > parent_id       ------->id parent of the account data
> > > name            ------->name of the account
> > > when i want to make a new account (it can account,sub account and
> > > child) i want to select the parent of that account..it will get from
> > > field id..
> > > i tried to write the followings script into the controller :
>
> > > function categoryParent(){
> > >                $parentinfo = $this->Category-
> > >>find('list',array('fields'=>array('Category.id','Category.name')));
> > >                $this->set('idparent',$parentinfo);
> > > }
>
> > First, I would name the variable something that better reflects what
> > the list is. This is all you should need in the controller.
>
> > $this->set(
> >         'categories',
> >         $this->Category->find('list')
> > );
>
> > > but i still dont know how to call the variable "idparent" in "add"
> > > view...so i can populate all "id" (not parent_id) in combobox..
> > > can sombody help me to solve this problem?
>
> > I'm not sure what you're asking here. This will create the select list:
>
> > echo $form->input('Account.category_id', array('options' => $categories));
>
> > Incidentally, if you were to use Andy Dawson's TreeHelper [1] you
> > could create the list items so that they appear threaded, eg:
>
> > category A
> > --- category A.1
> > ------ category A.1.a
> > ------ category A.1.b
> > --- category A.2
> > category B
> > category C
> > --- category C.1
>
> > It's a little complicated to understand at first but worth the time to
> > figure out.
>
> > [1]http://bakery.cakephp.org/articles/view/tree-helper-1

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to