Filtering related items error
Hi ,
I am trying to do the filtering using this article and i am getting this error: How can i fix that?
I am trying to do the filtering using this article and i am getting this error: How can i fix that?
Hi Alex,
I believe the problem is that these two lists are not exactly related by look up, here is the situation:
Main list A (form) has a drop-down column with departments and the support list B has the same column with departments (it is text now but i can turn is to choice with drop-down). I need to have information from the list B to be shown for reference purpose only when they choose a department in list A - show only those lines from list B which are appropriate. Does it make sense? Should it work?
Correction: these lists are actually connected but main list A has a look -up to list B to get all the roles...
I believe the problem is that these two lists are not exactly related by look up, here is the situation:
Main list A (form) has a drop-down column with departments and the support list B has the same column with departments (it is text now but i can turn is to choice with drop-down). I need to have information from the list B to be shown for reference purpose only when they choose a department in list A - show only those lines from list B which are appropriate. Does it make sense? Should it work?
Correction: these lists are actually connected but main list A has a look -up to list B to get all the roles...
Sure.
This is the main form with related item:
I also tried to show All items without filter in the data source...
And here is the code:
setHash();
fd.field('IFSDepartments').change(setHash);
function setHash(){
var value = encodeURIComponent(escape(fd.field('IFSDepartments').value())).replace(/\-/g, "%252D");
window.location.hash = "InplviewHash" + $(".related-roles [webpartid]").attr("webpartid") + '=FilterField=Department-FilterValue=' + value;
}
This is the main form with related item:
I also tried to show All items without filter in the data source...
And here is the code:
setHash();
fd.field('IFSDepartments').change(setHash);
function setHash(){
var value = encodeURIComponent(escape(fd.field('IFSDepartments').value())).replace(/\-/g, "%252D");
window.location.hash = "InplviewHash" + $(".related-roles [webpartid]").attr("webpartid") + '=FilterField=Department-FilterValue=' + value;
}
Hi Katy,
The error is quite usual, I can't yet understand the reasons. Please try it on a different list, create new fresh lists to test the filtering itself with no extra fields or scripts. It helps us to figure out where the problem comes from.
Please, use either JS hash filtering or data source, not both. If you need dynamic filtering, please, stick to JS only.
Data source filtering does not update dynamically with values on the form, it only runs once when the form is opened.
The error is quite usual, I can't yet understand the reasons. Please try it on a different list, create new fresh lists to test the filtering itself with no extra fields or scripts. It helps us to figure out where the problem comes from.
Please, use either JS hash filtering or data source, not both. If you need dynamic filtering, please, stick to JS only.
Data source filtering does not update dynamically with values on the form, it only runs once when the form is opened.
What about a brand new related items list? Is it the same behavior?
Please, try not to use both JavaScript and Data Source: Filter by form field.
Data Source: Filter by form field will only filter the results when you open the form, but won't work dynamically as you change IFSDepartments field, so it's best to leave it as Show all items from the view. This might be related to the error, so, please, change this setting.
Please, try not to use both JavaScript and Data Source: Filter by form field.
Data Source: Filter by form field will only filter the results when you open the form, but won't work dynamically as you change IFSDepartments field, so it's best to leave it as Show all items from the view. This might be related to the error, so, please, change this setting.
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Katy,
If this is the case, please, remove the script entirely. Try to go to the form, click the small arrow near the Department column (appears when you move the cursor over it), and select any value for filtering: What this essentially does is the same as the script. If you get the same error, please, try to do this outside the form, on the list itself.
Send us screenshots of the filtered list if this actually works in either the form, or the list itself.
If this is the case, please, remove the script entirely. Try to go to the form, click the small arrow near the Department column (appears when you move the cursor over it), and select any value for filtering: What this essentially does is the same as the script. If you get the same error, please, try to do this outside the form, on the list itself.
Send us screenshots of the filtered list if this actually works in either the form, or the list itself.
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 23 guests