@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
20 lines • 1.08 kB
JavaScript
import { getBestFitView } from "./getView";
//Check npmFunctions v2.1.63 for ICustViewDefKeys to replace prop interface
// 2024-02-04: This MAY NO LONGER BE NEEDED with addition of standard ICustViewOptions object passed into Drilldown
// ... Moved to separate file since it is no longer
export function getAppropriateViewProp(OrigViewDefs, currentWidth, prop) {
//2022-01-17: Added this to see if this gets mutated and breaks on refresh items. (One of these fixed it!)
//2022-01-18: Skipped the parse/stringify for performance after determining it was not causing the crash.
let viewDefs = OrigViewDefs; // JSON.parse(JSON.stringify(OrigViewDefs));
let result = false;
if (viewDefs) {
result = getBestFitView(viewDefs, currentWidth)[prop];
//console.log('getAppropriateDetailMode: ', result);
return result;
}
else {
alert('View Def is not available... can not show any items! - see getAppropriateViewProp()');
return null;
}
}
//# sourceMappingURL=getAppropriateViewProp.js.map