• Gianni Greggio
    August 23, 2017 at 2:13 am #4523

    Hi guys.

    I want that a button, external from a table, sets all elements of a specific column. Button and the table are in the same coach view called “ArticleTable”.

    On click button calls me.ui.getParent().SetDate();  … SetDate() is in Inline Javascript behaviour of “ArticleTable”.

    this.SetDate = function() {
    var dateToImpose = this.ui.get(“Date_Time_Picker2”).getDate();  //ok it’s works, I get the date from a datePicker external from the table
    this.ui.get(“Article_Table”).ui.get(“Date_Time_Picker1”).setDate(dateToImpose);   //it works only for the first row
    }

    My problem is that only the first row of my table changes its value in the column “Date_Time_Picker1″…

    How can I resolve this problem?

    thanks a lot

     

    SPARK Support
    August 24, 2017 at 7:29 am #4531

    Hi Gianni,

    If you are looking to change one element for the entire list, I would recommend using getData() on the Table.  Then loop through the list items, modify the value for the particular data element, and then setData() on the Table.

    Regards,

    Stephen P.

    Gianni Greggio
    August 24, 2017 at 7:36 am #4532

    Thanks Stephen.

    This is my solution. I loop the binding list of my object with a substitution:

    this.setDate = function() {
    var dateToImpose = this.ui.get(“Date_Time_Picker2”).getDate();

    var boundList = this.context.binding.get(“value”);
    var size = boundList.items.length;
    for( var i = 0; i<size; i++ )
    {
    var record = boundList.items[i];
    record.dataSpedizione = dateToImpose;
    boundList.put(i, record);
    }

    }

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

You must be logged in to reply to this topic.

Start typing and press Enter to search