Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

sap.m.Select in sap.m.Table - refreshing model of select

Hi,


we use a table with certain columns one column is a select. now the user can switch the content of this select by choosing a value in a dropdownbox! When the user changes the value I start an AJAX by getOnlineSelectXXX(), but the models didn't get updated? As I could see, the model is refreshed by:


var dataoSelect1 = data.modeloSelect1Data;
oSelect1.destroyItems();
$.each(dataoSelect1, function (i, elem) {
oSelect1.addItem(new sap.ui.core.Item({key: elem.Key, text: elem.Text}));
});

 

So when we add an additional row dynamically, the new model is choosen, but the older rows are based on the former values?


Is there a possibility to work with bindings, so the model is refreshed also in the old rows?`


regards

Meex


1 Comment

By now I do a workaround, on ajax success of the select data refresh

 

$.each(oTable.getItems(), function(i, itemTable) {
    let id = 'oSelect1-oTable-' + i;
    let cell = $.grep(itemTable.getCells(), function(e){ return e.sId == id; })[0];
    cell.destroyItems();
    $.each(oSelect1.getItems(), function(j, itemSelect) {
        cell.addItem(new sap.ui.core.Item({key: itemSelect.getKey(), text: itemSelect.getText()}));
    });
});

 

Login or Signup to post a comment