• Binary
    August 29, 2019 at 1:42 am #5542

    Hi there,

    I got a table where I would like to set default values for new added rows. I saw that I can set an event which triggers when you add a row but how can I adress the last added element?

    Thanks!

     

    SPARK Support
    August 29, 2019 at 6:37 am #5544

    Hi Binary,

    In order to add a record that is not blank, the On Add Row By User event needs to return a JavaScript objection matching the structure of the Business Object bound to the Table.  For instance, in my test harness, I have a complex type list containing two Strings, a Decimal, an Integer and a Date.  By placing the following code in the Add Row event, the new row is populated with some mock data based on the current record count:

    var count = me.getRecordCount(); return {str1: “String” + count.toString(), str2: “Test”, dec1:count/3, int1: 10 + count, date1: new Date()};

    Regards,

    Stephen P.

    Lalitha Vempati
    September 18, 2019 at 12:23 am #5555

    Hi Stephen,

     

    I have a requirement like in a table I have a button and when button is clicked the corresponding row should be selected and a screen should be shown with details about the item clicked. The table control does not select the row unless we use a selection column. I’m trying to systematically select the row on the On click event in the button control that I have as one column. The code I am using is:

    this.visibility=function(me){
    var index=me.ui.getIndex();
    var getrecord=me.ui.getParent().getRecord(index,false);

    me.ui.getParent().setRecordSelected( getrecord, true, true);

    I am calling visibility function on Onclick event of button control inside table like

    @visibility(me.ui.getIndex());

    Here i am able to get record selected using “var getrecord=me.ui.getParent().getRecord(index,false);”, the problem is on setting the record selected to table listselected using “me.ui.getParent().setRecordSelected( getrecord, true, true);” which is giving undefined when trying using that code.

    Could you please help me with this.

    Thanks in advance.

    SPARK Support
    October 1, 2019 at 10:56 am #5574

    Hi Lalitha.

    If you have the index of the record, why not use table.setRecordSelected(index) ?

    Regards,

    Stephen P.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search