UNPKG

devexpress-reporting

Version:

DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.

31 lines (30 loc) 1.06 kB
/** * DevExpress HTML/JS Reporting (designer\internal\_createObjectFromInfo.js) * Version: 25.1.3 * Build date: Jun 26, 2025 * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * License: https://www.devexpress.com/Support/EULAs/universal.xml */ export function createObjectFromInfo(control, serializationsInfo) { let newObj = undefined; const newObjInfo = []; serializationsInfo.forEach(info => { if (control[info.propertyName]) { if (newObj === undefined) newObj = {}; newObj[info.propertyName] = control[info.propertyName]; newObjInfo.push(info); } }); if (!!newObj) { newObj['getInfo'] = () => { return newObjInfo; }; } return newObj; } export function findFirstParentWithPropertyName(control, propertyName) { const parent = control.parentModel && control.parentModel(); if (parent) return parent[propertyName] ? parent : findFirstParentWithPropertyName(parent, propertyName); else return control.root; }