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.
Show several functional directories on the form
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Show several functional directories on the form
How to show several functional directories on one form?
For instance:
1 Departments
2 Computers
3 Equipment
All directories are linked.
Choosing an item in 1 -> 2 directory is filtered.
Choosing item in 2 -> 3 directory is filtered.
For instance:
1 Departments
2 Computers
3 Equipment
All directories are linked.
Choosing an item in 1 -> 2 directory is filtered.
Choosing item in 2 -> 3 directory is filtered.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Show several functional directories on the form
Use Hash Cookies in the Computers and Equipment select object. Then call nuRefreshSelectObject() in the onchange event of Departments and Computers to refresh the other select objects.
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Show several functional directories on the form
First, I want to figure out how to show a copy of the main directory (Departments) on an empty form. If as a subform, then a foreign key is required, but it is not needed here.kev1n wrote:Use Hash Cookies in the Computers and Equipment select object. Then call nuRefreshSelectObject() in the onchange event of Departments and Computers to refresh the other select objects.
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Show several functional directories on the form
Probably I am misrepresenting my idea. I'll try again ...kev1n wrote:Use Hash Cookies in the Computers and Equipment select object. Then call nuRefreshSelectObject() in the onchange event of Departments and Computers to refresh the other select objects.
I want the form to reflect the complete directory (in the form of a list) Departments and subordinate forms Computers and Equipment. Moreover, if I go to an item with a department, it should not open anything, as browseForm does. I have to get the name of the Department item and submit it to the subform for filtering. I'm primarily interested in - how to create a list of departments - leaning towards the HTML variant, but maybe there is a better way?
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Show several functional directories on the form
You can easily prevent this by adding this JS to your Browse Form.kknm wrote:Moreover, if I go to an item with a department, it should not open anything, as browseForm does.
Code: Select all
function nuSelectBrowse() {
return false;
}
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Show several functional directories on the form
I am migrating several Access databases to nuBuilder and want to achieve similar functionality.
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Show several functional directories on the form
For 1) you could use a select Object. Set multiple to true. Then call selectSingle() in the form's Custom Code so that just one item can be selected but to retain the list style.
For 2 + 3) Use Browse Forms (iFrame, Run) and use Hash Cookies (e.g. name A_HASH_COOKIE or a meaningful name) in your SQL to filter based on the selection.
In the select object, add an onchange event with a JS like the following to refresh a Browse form.
Code: Select all
function selectSingle(f) {
$('#' + f).removeAttr('multiple');
$('#' + f).attr('size', '5');
}
In the select object, add an onchange event with a JS like the following to refresh a Browse form.
Code: Select all
document.getElementById("browseIframeId").contentWindow.nuSetProperty('A_HASH_COOKIE',$('#select_obj_id').val());
$("#browseIframeId")[0].contentWindow.nuGetBreadcrumb(0);
You do not have the required permissions to view the files attached to this post.
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Show several functional directories on the form
I already guessed that 'Departments' should be like Select, I played with it for a long time and with nuRefreshSelectObject () from your previous answers, but I could not achieve anything.
Now new introductions that I can't figure out ...
I have:
1 Select:
Tag: Departments
Id: fltr
2 RUN:
Tag: Computers
Id: sub_kom
Type: iFrame
Filter:fltr
Record_id: empty
NuHash returns the 7 value of the selected field in 'select' as [fltr] => [\"'7\"']
I did this in onchange:
But nothing happens
How should i change your code for onchange ()?
Now new introductions that I can't figure out ...
Code: Select all
document.getElementById("browseIframeId").contentWindow.nuSetProperty('A_HASH_COOKIE',$('#select_obj_id').val());
$("#browseIframeId")[0].contentWindow.nuGetBreadcrumb(0);
1 Select:
Tag: Departments
Id: fltr
2 RUN:
Tag: Computers
Id: sub_kom
Type: iFrame
Filter:fltr
Record_id: empty
NuHash returns the 7 value of the selected field in 'select' as [fltr] => [\"'7\"']
I did this in onchange:
Code: Select all
document.getElementById ('sub_kom'). contentWindow.nuSetProperty ('fltr', $ ('# fltr'). val ());
$ ('# sub_kom') [0] .contentWindow.nuGetBreadcrumb (0);
How should i change your code for onchange ()?
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Show several functional directories on the form
Code: Select all
$ ('# sub_kom') [0] .contentWindow.nuGetBreadcrumb (0);
Code: Select all
$('#sub_kom')[0].contentWindow.nuGetBreadcrumb(0);
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Show several functional directories on the form
Of course, there are no spaces in the function - it's either the translator or the browser substitutes it.
Code: Select all
document.getElementById("sub_kom").contentWindow.nuSetProperty('fltr',$('#fltr').val());
$("#sub_kom")[0].contentWindow.nuGetBreadcrumb(0);