two related item child
Hi,
I have two related item child with refresh, but I can only refresh one of the related item child. I have a lookup field named Maquina, it's a parent. And two related item child, one is a horquilla list an the other is a bombas list. I want refresh the two child list when I select a Maquina in the lookup field. This is my javascript code:
//first filter on page load
setHashhorquilla();
setHashbomba();
//and attach an on-change handler that will call the filtering function wherever the value of the field changes
fd.field('Maquina').control().change(function() {
setHashhorquilla();
setHashbomba();
});
//this is the actual function that filters the list
function setHashhorquilla(){
//get value
var value = fd.field('Maquina').value();
//alert("Maquina"+value);
if (value == "(None)") {
value = "";
}
value = encodeURIComponent(escape(value)).replace(/\-/g, "%252D");
//set the URL’s hash value. An explanation on this is at the end of the article.
window.location.hash = "InplviewHash" + $(".related-horquilla [webpartid]").attr("webpartid") + '=FilterField=Modelo_x003a_ID-FilterValue=' + value;
}
function setHashbomba(){
//get value
var value = fd.field('Maquina').value();
//alert("Maquina"+value);
if (value == "(None)") {
value = "";
}
value = encodeURIComponent(escape(value)).replace(/\-/g, "%252D");
//set the URL’s hash value. An explanation on this is at the end of the article.
window.location.hash = "InplviewHash" + $(".related-bomba [webpartid]").attr("webpartid") + '=FilterField=Modelo_x003a_ID-FilterValue=' + value;
}
Thanks for your help.
Ruben
I have two related item child with refresh, but I can only refresh one of the related item child. I have a lookup field named Maquina, it's a parent. And two related item child, one is a horquilla list an the other is a bombas list. I want refresh the two child list when I select a Maquina in the lookup field. This is my javascript code:
//first filter on page load
setHashhorquilla();
setHashbomba();
//and attach an on-change handler that will call the filtering function wherever the value of the field changes
fd.field('Maquina').control().change(function() {
setHashhorquilla();
setHashbomba();
});
//this is the actual function that filters the list
function setHashhorquilla(){
//get value
var value = fd.field('Maquina').value();
//alert("Maquina"+value);
if (value == "(None)") {
value = "";
}
value = encodeURIComponent(escape(value)).replace(/\-/g, "%252D");
//set the URL’s hash value. An explanation on this is at the end of the article.
window.location.hash = "InplviewHash" + $(".related-horquilla [webpartid]").attr("webpartid") + '=FilterField=Modelo_x003a_ID-FilterValue=' + value;
}
function setHashbomba(){
//get value
var value = fd.field('Maquina').value();
//alert("Maquina"+value);
if (value == "(None)") {
value = "";
}
value = encodeURIComponent(escape(value)).replace(/\-/g, "%252D");
//set the URL’s hash value. An explanation on this is at the end of the article.
window.location.hash = "InplviewHash" + $(".related-bomba [webpartid]").attr("webpartid") + '=FilterField=Modelo_x003a_ID-FilterValue=' + value;
}
Thanks for your help.
Ruben
Hi!
You just need to implement minor changes in function setHashbomba():
You just need to implement minor changes in function setHashbomba():
Code: Select all
function setHashbomba(){
//get value
var value = fd.field('Maquina').value();
//alert("Maquina"+value);
if (value == "(None)") {
value = "";
}
value = encodeURIComponent(escape(value)).replace(/\-/g, "%252D");
//set the URL’s hash value. An explanation on this is at the end of the article.
var hash = window.location.hash;
window.location.hash = hash + "#InplviewHash" + $(".related-bomba [webpartid]").attr("webpartid") + '=FilterField=Modelo_x003a_ID-FilterValue=' + value;
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 16 guests