• Martin Lorenz
    April 11, 2017 at 6:25 am #4121

    Hello,
    I would like to ask for help. I have problem with service data table control. How I can change data element type only with last row? For example, I create table:

    
    this.setColumn = function() {
        thisView = this;
        var data = this.context.binding.get("value").get("dataType");
        var SDT = thisView.ui.get('Service_Data_Table1');
    
        if (data != undefined && data != null && data.items.length > 0) {
        for(var i = 0 ; i < data.items.length
            var columnSpaces = [{
                    width: "8%",
                    visibility: true,
                    sortable: false,
                    cssClass: "",
                    dataElementName: "value1",
                    type: "Text",
                    renderAs: "H",
                    label: "Label 1"
                },
                {
                    width: "15%",
                    visibility: true,
                    sortable: false,
                    cssClass: "",
                    dataElementName: "value2",
                    type: "Text",
                    renderAs: "H",
                    label: "Label 2"
                },
                {
                    width: "15%",
                    visibility: true,
                    sortable: false,
                    cssClass: "",
                    dataElementName: "value3",
                    type: "Decimal",
                    renderAs: "H",
                    label: "Label 3",
                    options: {
                        thousandSeparator: " ",
                        decimalSeparator: ","
                    }
                },
                {
                    width: "15%",
                    visibility: true,
                    sortable: false,
                    cssClass: "",
                    dataElementName: "value4",
                    type: "Decimal",
                    renderAs: "H",
                    label: "Label 4",
                    options: {
                        thousandSeparator: " ",
                        decimalSeparator: ","
                    }
                },
                {
                    width: "15%",
                    visibility: true,
                    sortable: false,
                    cssClass: "",
                    dataElementName: "value5",
                    type: "Decimal",
                    renderAs: "H",
                    label: "Label 5",
                    options: {
                        thousandSeparator: " ",
                        decimalSeparator: ","
                    }
                },
                {
                    width: "15%",
                    visibility: true,
                    sortable: false,
                    cssClass: "",
                    dataElementName: "value6",
                    type: "Decimal",
                    renderAs: "H",
                    label: "Label 6",
                    options: {
                        thousandSeparator: " ",
                        decimalSeparator: ","
                    }
                }
            ];
    
            SDT.setColumns(columnSpaces);
            SDT.refresh();
        }
    }
    

    Ok, end this code works good but all columns have the same type. I would like to change (value6, Label 6) data element type or hide it but only in last row becouse last row in six column must be empty. It is possible? Please help.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search