Champ select avec groupefield ?

More
5 years 4 months ago #75512 by FLAG
Salut Micker,
j'ai trouvé ce code et ça fonctionne, je vais tenter de l'adapter !
c'est une fonction que l'on retrouve souvent dans les formulaires, dommage que ce ne soit pas pris en charge avec les champs flexi ! très pratique le truc !

ps: à quand la sortie de la version Pro ?
et pourra t'on tester le backend avant ?
<html>
<body>
<!-- utilisation de JQuery via google api -->
<script src=" ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js ">
<select id="cat">
<option value="1">Cat A</option>
<option value="2">Cat B</option>
</select>
<select id="souscat"></select>

<script>
var sousCategories = { "1" : { "1": "Cat 1 Sous-cat 1", "2": "Cat 1 Sous-cat 12" },
"2" : { "1": "Cat 2 Sous-cat 1", "2": "Cat 2 Sous-cat 2" }};
$( "#cat" ).change(function() {
var codeCategorie =$( "#cat" ).val() ;
var identifiantSelectSousCategorie = '#souscat';
// on vide la liste
$(identifiantSelectSousCategorie ).empty();
// Affichage des valeurs en console si besoin
//console.log(sousCategories);
//console.log(codeCategorie);
//console.log(sousCategories[codeCategorie]);
// On charge les nouvelles valeurs
$.each(sousCategories[codeCategorie], function(key, value) {
$(identifiantSelectSousCategorie)
.append($('<option>', { value : key })
.text(value));
});
});
// On déclange l'événement du changement sur le select de la catégorie.
$( "#cat" ).trigger("change");
</script>
</body>
</html>

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

More
5 years 4 months ago #75513 by micker
hello merci pour le code
a mon avis pas besoins de jquery car il est déjà charger pour le reste sympa
pour la version pro il ne va pas y a voir de nouveauté dans l'admin mais se sera un ensemble de plugin template modules qui permettrons de nouvelles choses (review, panier, template de catégorie, export import de type et template, etc)

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
5 years 4 months ago #75514 by FLAG
OK, ben on attend donc la version Pro !
A + et Merci Micker !

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

More
5 years 4 months ago #75515 by micker
++

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.306 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline