› Forums › Classic DFFS › JS that utilizes the “Group ID” functionality?
- This topic has 8 replies, 3 voices, and was last updated 4 weeks ago by Alexander Bautz.
-
AuthorPosts
-
-
June 17, 2022 at 17:20 #35884Jon WhismanParticipant
We have forms that use pure JS – no rules in dffs back-end.
I would like to leverage the Group ID functionality to bulk control groups of fields / headers, etc. in the form (hide this group, show that group, read only this group, etc.)
Is there SPJS syntax to utilize the group IDs?
EG:
//un-hide fields
spjs.dffs.unhideFieldsByRule([
TabGroup_xxx
]); -
June 17, 2022 at 19:40 #35886Alexander BautzKeymaster
The fields in the tabgroup can be found as an array in this object:
spjs.dffs.data.dffsDataObj.data.groupToFin
This means you can loop over the fields in a group like this:
jQuery.each(spjs.dffs.data.dffsDataObj.data.groupToFin.YOUR_GROUP_NAME, function(i, fin){ // do something with fin here });
Alexander
-
June 22, 2022 at 17:42 #35892Jon WhismanParticipant
AWESOME! THANK YOU, Alexander!
-
March 29, 2024 at 22:25 #37602Bryan WaldropParticipant
What would showing fin look like?
-
March 31, 2024 at 19:42 #37603Alexander BautzKeymaster
Not sure I understand what you mean by showing fin – do you mean in code identify the fin, or using code to show the corresponding field in the form?
Alexander
-
-
March 31, 2024 at 21:35 #37604Bryan WaldropParticipant
I am familiar the following custom js for working with a single column but I seem to be missing some syntax for the group id method above for group ID:
$(“#dffs_FieldInternalName”).hide();
$(“#dffs_FieldInternalName”).show();
spjs.dffs.flag_Mandatory([“FieldInternalName”]);
spjs.dffs.clear_Mandatory([“FieldInternalName”]);
spjs.dffs.doReadOnly([“FieldInternalName”]); -
April 1, 2024 at 09:13 #37605Alexander BautzKeymaster
You must use the fin variable in the loop like this:
jQuery.each(spjs.dffs.data.dffsDataObj.data.groupToFin.YOUR_GROUP_NAME, function(i, fin){ // do something with fin here console.log(fin); jQuery("#dffs_" + fin).hide(); spjs.dffs.flag_Mandatory([fin]); });
Alexander
-
April 1, 2024 at 14:28 #37606Bryan WaldropParticipant
Perfect and thank you! Putting money in the piggy bank!
-
April 1, 2024 at 18:52 #37607Alexander BautzKeymaster
Thanks!
Alexander
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.