New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize element value from a Data Source query #105
Comments
@rantinray Thank you for opening the feature request. I got the same issue recently, when tried to use Custom Code for the initial Request. I will expose |
@mikhail-vl Thank you for your response. Could you possibly provide an example usage when you have it implemented? I will watch for a new release! |
@rantinray I will, I hope to including it in the upcoming release this week. |
@rantinray PR merged and will be a part of the today's release:
|
@mikhail-vl I have installed the new v2.6.0 plugin to try to use the new 'setInitial()' function, but I am not able to get it to work. What value should I use for the 'name' property? I have been using the 'element.id' of the form element I want to initialize. Is this correct? Thanks, |
@rantinray To highlight and Require Confirmation, the panel verifies the value for each element with initial values set as a hash of element.id and values. I agree. Maybe the example is misleading with
Is it clear? |
@mikhail-vl Yes, that is much clearer for me. I should have let you know that I eventually worked it out toward the end of my day. I am pretty new to javascript so between looking at your code and trial and error I worked it out. Thanks! I have another possible enhancement request. Would it be possible to add a function called something like "updatedValues()" that returns a container of the update values in the form {'id1':'newValue1', 'id2':'newValue2', ...}. This would basically match the table you build for the confirmation dialog. This would be helpful to me when building the "Update Request". I currently have to send all form elements in the update when only a select few have changed. I don't believe there is any other way for me to determine what has changes in the form. Let me know if I should make this a "new" issue, or if it is out of scope. I can provide example screen shots of what I am doing if that helps. Thanks again for your quick responses and very useful plugin! -Ray |
@rantinray That's a totally valid request. Please open a new issue to track it and we will work on it. |
I am trying to initialize a "Select with Custom options" element with Custom Code in the Initial Request. The initial request is '-' and the URL is blank as I am just trying to use data from a Prometheus query. I see that I have the values I want in the data element and I am able to assign them to the element.value fields. But this does not seem to affect the "initial" value which is used to detect changes in the elements and is shown as the "Old Value" in the confirmation table. Is there a way to set the initial value from Custom Code without an Initial Request query
The text was updated successfully, but these errors were encountered: