Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
hide(show) subform columns(objects)
hide(show) subform columns(objects)
Hi. Please Tell me how to hide or display the fields in the subform (grid or shape view) by the name of the object. I've been trying to find this supposedly simple information for half a day.
I tried nuSubformHideColumns(), but this function completely breaks the appearance of the subform.
I tried nuSubformHideColumns(), but this function completely breaks the appearance of the subform.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: hide(show) subform columns(objects)
Which objects are you using and what does the subform look like?
Re: hide(show) subform columns(objects)
I need to leave the required number of columns based on the number of days in the month. The objects are of type "input nuNumber" and "select". One for each day of the month.
How to count the days and cycle through the names of objects is clear to me, but how to hide the extra columns is not.
PS: Another problem I'm facing is the automatic size of the sub form depending on the size of the browser window.
How to count the days and cycle through the names of objects is clear to me, but how to hide the extra columns is not.
PS: Another problem I'm facing is the automatic size of the sub form depending on the size of the browser window.

You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: hide(show) subform columns(objects)
Code: Select all
nuSubformHideColumns('subformId',['subform_column1','subform_column2'])
Re: hide(show) subform columns(objects)
Code: Select all
let dstr = nuGetValue("mt_date") + ".01";
let d1 = new Date(dstr);
let days = 31 - new Date(d1.getFullYear(), d1.getMonth() + 1, 0).getDate();
for (let i=1; i<= days; i++)
{
nuSubformHideColumns("mt_items",["tmi_" + String(32-i),"tmi_val_" + String(32-i) ]);
}
You do not have the required permissions to view the files attached to this post.
Re: hide(show) subform columns(objects)
Quick question. Is it possible to get an unformatted object value. For example , an object of the nuDate type has the format "yyyy.mm ". Is it possible to get the original date value in the JS code?
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: hide(show) subform columns(objects)
nuSubformObject() returns a JavaScript object that can be looped through.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: hide(show) subform columns(objects)
Try calling nuSubformHideColumns() just ones, by passing all columns to hide. Subsequent calls might be causing that issue.
Re: hide(show) subform columns(objects)
But there is no field in this object that contains the value of the object. I would like to get the original value of the object, not the subform rows.kev1n wrote: ↑Mon Mar 28, 2022 8:54 am nuSubformObject() returns a JavaScript object that can be looped through.
Code: Select all
{id: 'mt_date', foreign_key: undefined, primary_key: undefined, object_id: '623094507f98840', table: undefined, …}
action: "save"
chartData: [Array(0)]
chartDataPivot: []
columns: []
deleted: []
edited: []
fields: ['ID']
foreign_key: undefined
id: "mt_date"
object_id: "623094507f98840"
primary_key: undefined
rows: []
table: undefined
[[Prototype]]: Object
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: hide(show) subform columns(objects)
The sf values are in .rows
Code: Select all
nuSubformObject('sfobj....').rows