473
Views
4
Comments
Editable Table Custom Add Record
Question
Hi,

I am looking for the functionality where, when I click on "Add Record" of an Editable table,  The new row that It provides to enter data should be prefilled with the data from the previous row. Appreciate help to achieve this. 

UserImage.jpg
christopher woodruff
Vimal Abhishek wrote:
Hi,

I am looking for the functionality where, when I click on "Add Record" of an Editable table,  The new row that It provides to enter data should be prefilled with the data from the previous row. Appreciate help to achieve this. 
 
 Hello Vimal, I have the same question.  I have foudn the WidgetClick Action in Forge but now I need to know what the Id of the Add button on the edit table is :-)  Any on ehtat can help us?
Thanks!
Chris
 
UserImage.jpg
Wilko Odijk

Hi there,

Any solution on this? I am interested in it.

I am also interested in a hide/show possibility of the add record, depending on circumstances in my page.

Thanks,

Wilko



2019-11-08 16-23-42
César Mateus Conceição

I'm looking for this too. Any news about this? Thx

2020-10-27 09-20-27
John Salamat
 
MVP

javascript like this should work

$('.EditableTable td.RowWithAddAction a').click(function() {

    let newTr = $('.EditableTable tr').eq(-3);

    $('.EditableTable tr').eq(-4).find('td').each(function(index){

        if ($(this).find('select').length > 0) {

            $(newTr.find('td').get(index)).find('select').val($(this).find('select')[0].value);
        } 
        else if ($(this).find('input').length > 0) {
            $(newTr.find('td').get(index)).find('input').val($(this).find('input')[0].value);
        }
    });
});


Tested only for select and textbox, adding other html controls can be done by adding additional else if. Feel free to improve it :)

https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/JavaScript/Extend_Your_Web_Application_Using_JavaScript/Define_and_Run_JavaScript_Code

John

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.