While developing a Oracle JET application against APIs on Oracle Service Bus interacting to JD Edwards and Oracle Transportation Management, we ran into a challenge. In the table (ojTable) that we had included in a page, we wanted to have column filters – fields in each column header where the user can enter a filter criteria for that column. The ojTable component supports the headerTemplate property (next to a rowTemplate and a footerTemplate). A headerTemplate is defined separately from the ojTable and can contain various components as well as script.
Our table and template were defined as follows:
It was our intent to have changes in the inputText in the column header – the filter field – immediately picked up and processed; in the ViewModel, code should be triggered by the change and should filter the data in the ArrayTableDataSource bound to the ojTable. The ViewModel has an observableArray on which the ArrayTableDataSource is based – by manipulating that observableArray we can get our table to refresh. The ViewModel also contains a KnockOut observable called country. It is this observable that we want to databind the inputText in the headerTemplate to. By subscribing our own function to this country observable we hope to be triggered when the user enters a value in the inputText and react in style.
The ViewModel: Read the complete article here.
For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.