Cascading LookUp
- Gregory Murillo
- Posts: 8
- Joined: Wed Jun 17, 2015
Hello Guys,
I have the following issue
I have a form with a Related Item. In the related Item, I have a cascading lookup column (Artfulbits Component) and I have a Text Filed called Entity. Entity field is automatically filled with the a value that was previously selected from the parent.
Problem is that once the value is assigned to the text field, it look like the onchange event is not executed, and it is needed in order to take the value to be used as the filter for the cascading component.
If I manually add the value to the text field and move to the next, the onchange event is fired and the cascading filter works fine.
Is there a way to force the onchange event when I assign a value to the text field? This is my code:
$(document).ready(function(){
var updateField = function(){
var something = window.top.fd.field('Entity').value(); //This is a lookup colum on the parent
var parentID = fd.getSourceID();
if (parentID) {
fd.field('ParentID').control().value(parentID);
$('.parent-field').hide();
}
fd.field('_x006e_bp4').value(something);
}
setTimeout(updateField,3000);
});
Thanks in advance for any help.
I have the following issue
I have a form with a Related Item. In the related Item, I have a cascading lookup column (Artfulbits Component) and I have a Text Filed called Entity. Entity field is automatically filled with the a value that was previously selected from the parent.
Problem is that once the value is assigned to the text field, it look like the onchange event is not executed, and it is needed in order to take the value to be used as the filter for the cascading component.
If I manually add the value to the text field and move to the next, the onchange event is fired and the cascading filter works fine.
Is there a way to force the onchange event when I assign a value to the text field? This is my code:
$(document).ready(function(){
var updateField = function(){
var something = window.top.fd.field('Entity').value(); //This is a lookup colum on the parent
var parentID = fd.getSourceID();
if (parentID) {
fd.field('ParentID').control().value(parentID);
$('.parent-field').hide();
}
fd.field('_x006e_bp4').value(something);
}
setTimeout(updateField,3000);
});
Thanks in advance for any help.
-
- Moderator
- Posts: 33
- Joined: Wed Sep 21, 2016
Hello, Gregory Murillo!
To activate handling of changing the value you can just use function “trigger(‘eventName’)” like that:
To activate handling of changing the value you can just use function “trigger(‘eventName’)” like that:
Code: Select all
fd.field('_x006e_bp4').control()._el().find('input').trigger('change')
-
- Information
-
Who is online
Users browsing this forum: No registered users and 6 guests