select single not populating in ADP table.
Summary:
I have an ADP table in which one of the columns is a Select-Single template. The select-Single has a
CollectionTemplate as Table. When the data loads in the table, the CollectionTemplate Table is not dropping in the select-single.
Content (required):
I have a table with an ADP variable bound to it whose type structure is
I want to display the Price array as a Select-Single dropdown in the table as one of the columns(baseprice column).
Thia the code for select-single component in this table.
<oj-table scroll-policy="loadMoreOnScroll" class="oj-flex-item oj-sm-12 oj-md-12"
columns='[{"headerText":"productcode","field":"productcode"},{"headerText":"description","field":"description"},{"headerText":"pack","field":"pack"},{"headerText":"schedules","field":"schedules"},{"headerText":"baseprice","sortable":"disabled","template":"multiFieldCellTemplate5"}]'
data="[[ $variables.itemLinesDataADP ]]">
<template slot="multiFieldCellTemplate5"><oj-select-single id="deals" data="[[ $functions.createADPData($current.row.price) ]]" item-text="baseprice">
<template slot="collectionTemplate">
<oj-table style="z-index:1000" scroll-policy="loadMoreOnScroll"
data="[[ $functions.createADPData($current.data) ]]"
columns='[{"headerText":"BasePrice","field":"baseprice"},{"headerText":"MIN","field":"min_tier"},{"headerText":"MAX","field":"max_tier"},{"headerText":"Bonus","field":"bonus"},{"headerText":"Discount","field":"discount"}]'></oj-table>
</template>
</oj-select-single>
</template>
</oj-table>
define(["ojs/ojarraydataprovider"], (ArrayDataProvider) => {
'use strict';
class PageModule {
createADPData(data) {
console.log(JSON.stringify(data));
console.log("data received" + data[0].baseprice);
let dataprovider = new ArrayDataProvider(data,{ keyAttributes: "bonus",});
console.log("data Sending back"+ JSON.stringify(dataprovider));
return dataprovider;
}
}
return PageModule;
});
Tagged:
0