Question: How to render a tool form with predefined parameters?
0
Evgeny Anatskiy • 0 wrote:
The goal is to update the form:
And get the following:
After creating a form:
var toolForm = new ToolForm.View({
id: tool.get('id'),
version: tool.get('version')
});
toolForm.deferred.execute(function() {
Galaxy.app.display(toolForm);
});
I'm trying to redraw it with non-default parameters (i.e., Cut columns: c3):
var form = toolForm.form;
form.deferred.reset();
form.deferred.execute(function(process) {
me._updateModel(form, process);
});
...
_updateModel: function(form, process) {
var currentState = {
tool_id: this.toolId,
tool_version: this.toolVersion,
inputs: $.extend(true, {}, form.data.create())
};
currentState.inputs.columnList = 'c3';
Utils.request({
url: Galaxy.root + 'api/tools/' + this.toolId + '/build',
type: 'POST',
data: currentState,
success: function(newModel) {
window.newModel = newModel;
form.update(newModel['tool_model'] || newModel);
form.options.update && form.options.update(newModel);
...
}
});
...
}
In the response from the server, I can see the changed parameter, but the field itself (Cut columns) is not refreshed.
The question is: how to refresh all the fields with new parameters so that the form after pressing the Execute button would send correct (updated) parameters?
P.S. I was looking into client/galaxy/scripts/mvc/tool/tool-form-base.js to see how forms are being updated.
ADD COMMENT
• link
•
modified 21 months ago
by
aysam.guerler ♦ 90
•
written
21 months ago by
Evgeny Anatskiy • 0