Create Views using Cell Template
You can create views using cell templates from the view configuration page (Edit Business Entity > Data Views >click insert to create a new one or double-click on an existing view).
Cell template is a text editor element or a collection of elements. Using cell templates, you can create views with default or custom fetch.
Creating views default fetch
Reference the attributes by using the fetch alias or by their name.
Cell Template
Copy
return {
"entity": {
"alias": "base",
"name": "Account",
"attributelist": [
{
"name": "Accountid"
},
{
"name": "typeId"
},
{
"name": "Email"
},
{
"name": "EmploymentStatusId"
},
{
"name": "MAI"
},
{
"name": "MobilePhone"
},
{
"name": "Name"
},
{
"name": "PIN"
}
],
"join": [
{
"type": "inner",
"entity": {
"alias": "BWstatus",
"name": "BWstatus",
"attributelist": [{
"name": "label",
"alias": "label"
}],
},
"fromto": [
{
"from": "businessStatusId",
"to": "BWstatusid"
}
]
}
]
}
}
Starting with FintechOS you can also fetch view data using the Code Editor.
Creating views with custom fetch
To create views with custom fetch, reference the attributes by using the custom alias:
Copy
//Fetch object expression text editor
return {
"entity": {
"alias": "base",
"name": "Account",
"attributelist": [
{name:"Accountid"},
{name:"Name"},
{name:"UniqueID"},
{name:"PIN"},
{name:"FiscalRegistrationNo"},
{name:"CommercialRegistration"},
{name:"FirstName"},
{name:"LastName"},
{name:"MobilePhone"}
],
"join": [{
"type": "left",
"entity": {
"alias": "accType",
"name": "FTOS_CMB_AccountType",
"attributelist": [{name: "FTOS_CMB_AccountTypeid"},{name: "name", alias: "TypeName"}]
},
"fromto": [{
"from": "typeId",
"to": "FTOS_CMB_AccountTypeid"
}]
}]
}
};
On the view, in the Code tab, After Generate JS section, provide the code to apply the desired logic.
Copy
var view = {editFormName:"FTOS_CMB_BaseAccount", insertFormName:"FTOS_CMB_BaseAccount"};
var gridId = 'ebsContainerContent';
var dataGrid = $('#' + gridId).dxDataGrid('instance');
dataGrid.option('onRowClick', function (h) {
console.log("Custom click");
var component = h.component,
prevClickTime = component.lastClickTime;
component.lastClickTime = new Date();
if ((prevClickTime && (component.lastClickTime - prevClickTime < 300)) || ebsIsOnMobile) {
var nameAttr = dataGrid.option("nameAttribute");
var key = h.key;
var entityName = dataGrid.option("entityName");
window.location.href = ebs.getEditNavigationUrl(entityName, key, null, view.editFormName);
}
});
var formData = ebs.getFormData();
if(currentPageActionHandlers.find(function(x){ return x.text == "Insert"; }))
{
currentPageActionHandlers.find(function(x){ return x.text == "Insert"; }).handler = function(){
ebs.generateInsert("ebsContainer", "Account", null, null, "FTOS_CMB_BaseAccount");
};
}