Hi ,
I am facing an issue with oracle JET detail table. Here I have a field in the OJET detail table which has editable value. I tried to create oj input text inside a <td> as shown below
var EditableCell = document.createElement('td');
var input = document.createElement("oj-input-text");
input.setAttribute('value',context.row.Editable text());
I am trying to get the edited value through offset function as shown below but the rowcopy always returns old value.
self.dataprovider.fetchByOffset({offset: index}).then(function (value)
{
var row = value['results'][0]['data'];
var rowCopy = {};
Object.keys(row).forEach(function (attr) {
rowCopy[attr] = row[attr]();
});
console.log('rowcopy'+JSON.stringify(rowCopy));
In order to make the fields editable i have made each attribute of dataprovider array as knockout observable.
deptArrayObservable = self.deptArray.map(function (row) {
Object.keys(row).forEach(function (attr) {
row[attr] = ko.observable(row[attr]);
});
return row;
});
Approach works fine while using a simple editable table but doesn't work with the detail table.
I just tried various ways to set the value attribute like mentioned below but nothing worked
input.setAttribute('value','{{$context.row.BID_AMOUNT}}');
or input.setAttribute('data-bind','value: $context.row.BID_AMOUNT');
please not OJET version is 5.1.0
Appreciate any help on the following.
Thanks & Regards,
Manish Mathew