1 answer
- 210
You can use the Handsontable JS code to add values to a grid at runtime by reading the query string, splitting the values, and inserting rows.
Spreadsheet Deep Customizations- Fabian Barrera
Hi Mr. Singh, Thanks for your answer.
In order to validate the way to store the values in the form I have tested passing the values to a text field, but I´m afraid that I need more help with the way to work with the JS Code and Handsontable that you post here, could you share an example for the JS code or maybe a joget app please.?
- Fabian Barrera
Finally I found a solution with Java Script
<script type="text/javascript">
$(function(){
var value = decodeURIComponent("#requestParam.lista_deproductos#"); // Replace with the parameter name you declared in datalist action
var values = value.split(';');
var hot = FormUtil.getField("lista_deproductos").data("hot");
// Iterate over each value and set it in the table
$.each(values, function(index, value) {
if (value.trim() !== "") { // Ensure non-empty values
hot.setDataAtRowProp(index, 'id_producto', value);
}
});});
</script>
Add your comment...
Hi community.
I´m trying to configure a Hyperlink button in a datalist to open a form that have a spreadsheet, I´m stuck because don´t understand how must be conformed the URL to fill the spreadsheet, please anybody have an example to guide me?
Note: In this pic, I´m showing what part of the URL with the problem, as syou can see I can´t fill the spreadsheet .
The value lista_deproductos is the id for the spreadsheet in the form, also the field id_producto is the name of the first row in the spreadsheet .
This part of the URL:
web/embed/userview/isr/isr/_/new_request?_mode=add&lista_deproductos=0000000000000000024;0000000000000000029;0000000000000000021