Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • krasy
  • krasy's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 90
  • Thank you received: 8
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? ;)

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

Last edit: by admin. Reason: code fix
  • Page:
  • 1
Time to create page: 0.063 seconds

Freakin' Awesome!!! J-Cook is simply awesome - whether you're a highly experienced developer or complete novice whether you're building a small inventory component or a complete community solution! The beauty comes from a fast slick and reliable platform that readily provides developers with everything they'll need to build the backbone of a solid and secure component with wizards for authoring access publishing aliasing created/modified by dates... you name it COOK provides it! J-Cook really surpasses all of the 'competition' as far as MVC tools are concerned! Try love it and get cooking!
learnthrusong (JED)
          

Get Started