Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Questions related to using nuBuilder Forte.
joecocs
Posts: 67 Joined: Wed Jul 04, 2018 4:11 pm
Location: France
Unread post
by joecocs » Fri Jul 06, 2018 11:56 am
Hello,
In my app I have several sub-forms and for clarity I want to put a color to each form.
I tried to assign a style in JScript to each form, but it does not work because I do not understand the syntax.
I am a newbee in JScript and Nubuilder !!!
Thanx for your help.
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Fri Jul 06, 2018 12:03 pm
Hi,
Here's an example:
To set a different background color, place this code in your mainform's JavaScript field:
Code: Select all
if (nuFormType() == 'edit') {
$('#ID_of_your_subform').css("background-color", "red");
}
Replace ID_of_your_subform with the ID of your subform.
You do not have the required permissions to view the files attached to this post.
joecocs
Posts: 67 Joined: Wed Jul 04, 2018 4:11 pm
Location: France
Unread post
by joecocs » Fri Jul 06, 2018 12:18 pm
toms wrote: Hi,
Here's an example:
To set a different background color, place this code in your mainform's JavaScript field:
Code: Select all
if (nuFormType() == 'edit') {
$('#ID_of_your_subform').css("background-color", "red");
}
Replace ID_of_your_subform with the ID of your subform.
Thank you for your quick response,
that I arrived there,
but is there not a syntax to change the color of the current form or TAB ?
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Fri Jul 06, 2018 1:30 pm
Try this:
Code: Select all
$('#nubody').css("background-color", "red");
Or:
Code: Select all
$('#nuRECORD').css("background-color", "red");
joecocs
Posts: 67 Joined: Wed Jul 04, 2018 4:11 pm
Location: France
Unread post
by joecocs » Sat Jul 14, 2018 12:19 pm
Nice !
I use it
Just one detail for a subform in subform in form this is in normal color.?!?
If you have a solution for change its colour
Thank you
toms
Posts: 785 Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms » Mon Jul 16, 2018 11:42 am
Something like this:
Code: Select all
$(window.parent.document).find('#ID_OF_THE_SUBFORM_OBJECT').contents().find('#nuRECORD').css('background-color','red');
(Replace ID_OF_THE_SUBFORM_OBJECT with the subform object id)
joecocs
Posts: 67 Joined: Wed Jul 04, 2018 4:11 pm
Location: France
Unread post
by joecocs » Tue Jul 31, 2018 3:04 pm
Hello, thank you for your help.
toms wrote: Something like this:
Code: Select all
$(window.parent.document).find('#ID_OF_THE_SUBFORM_OBJECT').contents().find('#nuRECORD').css('background-color','red');
(Replace ID_OF_THE_SUBFORM_OBJECT with the subform object id)
I don't understand where i write this (in form, in sub-form or in record of sub-form ?)
see you soon