Hi all,
I am unable to display oj-table on UI in oracle JET. Please refer my code.
customer.html:
<!--
Copyright (c) 2014, 2022, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0
as shown at https://oss.oracle.com/licenses/upl/
-->
<div class="oj-hybrid-padding">
<oj-table id="table" aria-label="Employee Table" data="[[datasource]]" columns='[{"headerText": "Employee Number", "field": "empno"},
{"headerText": "Employee Name","field": "ename"},
{"headerText": "Job","field": "job"},
{"headerText": "Manager","field": "mgr"},
{"headerText": "Hire Date","field": "hiredate"},
{"headerText": "Salary","field": "sal"},
{"headerText": "Commission","field": "comm"},
{"headerText": "Dept No","field": "deptno"}]' class="demo-table-container">
</oj-table>
</div>
customer.js:
/**
* @license
* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
* Licensed under The Universal Permissive License (UPL), Version 1.0
* as shown at https://oss.oracle.com/licenses/upl/
* @ignore
*/
/*
* Your customer ViewModel code goes here
*/
define(['ojs/ojcore','jquery', 'knockout','ojs/ojtable','ojs/ojarraytabledatasource'],
function(oj,$, ko) {
function CustomerViewModel() {
var employeeArray=\[{empno:1001,ename:'Test',job:'test job',mgr:123,hiredate:'12-JAN-2003',sal:100,comm:123,deptno:10}\];
this.datasource= new ArrayTableDataSource(
employeeArray,
{idAttribute:'empno'}
);
}
/\*
\* Returns an instance of the ViewModel providing one instance of the ViewModel. If needed,
\* return a constructor for the ViewModel so that the ViewModel is constructed
\* each time the view is displayed.
\*/
return CustomerViewModel;
}
);
Here I am trying to display static array table data on UI. Output is not getting on UI.
Could any one help me with this.
Thanks in advance
Manikanta.R