Welcome, Guest
Username: Password: Remember me

TOPIC: Ajax Combobox - nested lists

Ajax Combobox - nested lists 20 Oct 2014 14:11 #12710

  • krasy
  • krasy's Avatar
  • Offline
  • Premium Member
  • Posts: 90
  • Thank you received: 8
  • Karma: 5
hi,
i have a table of places that looks like this:
-place
-parent place

i want to modify ajax combox to have a possibility to
select
>in the beginning from places without parent
>go to the bottom in nested records,
>choose the last nested record

could you provide me some guidelines? ;)
The administrator has disabled public write access.

Ajax Combobox - nested lists 20 Oct 2014 19:01 #12712

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Is it a 'nest' table design ?

I mean, will your program treat 'places' table as a hierarchical table ? (Not possible yet in cook, but coming)
Because if you plan then to have such structure, then the code must be coded in a recursive way.

MODEL
prepareQuery():
Invent a new state name for this query wich will sort the rooted places first

VIEW
The combo boxes are filled in the view file.
Open the view file corresponding to the layout you want and complete / modify the code there.
All you have to do is
model->setState('myNewInventedState', true);

HTML
If you want to group datas in the combo, then you can do it easily with JDom ('groupby' property)
You can eventualy do this before in the builder (Group By : [FK] parent place > title )

Hope it helps.
Coding is now a piece of cake
Last Edit: 20 Oct 2014 19:04 by admin. Reason: code fix
The administrator has disabled public write access.
Time to create page: 0.098 seconds

Get Started