Grouping Checkboxes?

A place for users and developers of the Xataface to discuss and receive support.

Grouping Checkboxes?

Postby egonux » Mon May 14, 2012 5:56 am

Hi Steve,

first of all, thanks for your great application!

Background:
Right now, I'm working on a slightly elaborated library system with Xataface and I could find nearly everthing in the Wiki or Forum, but now I could need some help:
I've got a table with publications (the main table), and beside some others, a table with categories and a table with catchphrases, they look like

[publications]
id ... catchphrase_id

[categories]
id name

[catchphrases]
id name category_id

Problem:
I've got 690 catchphrases sorted in 16 categories and i would like to group them. Means, if I create a new record, I would like to
1st: select one or more categories
2nd: select one or more catchphrases from these categories.

Could you give me a hint on how i could achieve this?

Thank you very much & best regards
Axel
egonux
 
Posts: 2
Joined: Mon May 14, 2012 3:45 am

Re: Grouping Checkboxes?

Postby shannah » Tue May 15, 2012 9:56 am

You'll need to do something with Javascript here.
First, if you add a third column to the select of the catchphrases valuelist __sql__ query, where this third column identifies which category the catchphrase is associated with, then you'll see that this value is added as a CSS class to the checkbox corresponding to that catchphrase.
Then you can use javascript to show or hide catchphrase checkboxes depending on which categories are selected. Wrap this in a javascript function and add it to both the document's ready event and the change event of the category checkboxes.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Grouping Checkboxes?

Postby egonux » Tue May 29, 2012 3:53 am

Hi Steve,

thanks to your reply.

I'm not too familiar with Javascript, so could you help me with this (on account)?

Best regards
Axel
egonux
 
Posts: 2
Joined: Mon May 14, 2012 3:45 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 18 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved