Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
portal-apps-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
portal-apps-manage
Commits
112d869e
Commit
112d869e
authored
Sep 08, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perspective
parent
57308f04
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
17 deletions
+33
-17
dashboard-management.component.ts
...ge/dashboard-management/dashboard-management.component.ts
+5
-5
base-widget.component.ts
src/app/portal-manage/widgets/base-widget.component.ts
+1
-0
syncfusion-datagrid-widget.component.html
...datagrid-widget/syncfusion-datagrid-widget.component.html
+1
-0
syncfusion-datagrid-widget.component.ts
...n-datagrid-widget/syncfusion-datagrid-widget.component.ts
+11
-6
syncfusion-pivot-widget.component.html
...usion-pivot-widget/syncfusion-pivot-widget.component.html
+1
-0
syncfusion-pivot-widget.component.ts
...cfusion-pivot-widget/syncfusion-pivot-widget.component.ts
+14
-6
No files found.
src/app/portal-manage/dashboard-management/dashboard-management.component.ts
View file @
112d869e
...
@@ -371,11 +371,8 @@ export class DashboardManagementComponent implements OnInit {
...
@@ -371,11 +371,8 @@ export class DashboardManagementComponent implements OnInit {
configObject
=
{
...
widget
.
config
};
// Create a shallow copy
configObject
=
{
...
widget
.
config
};
// Create a shallow copy
}
}
// Inject widgetId
and perspective
into the config for the component
// Inject widgetId into the config for the component
configObject
.
widgetId
=
widget
.
widgetId
;
configObject
.
widgetId
=
widget
.
widgetId
;
if
(
widget
.
perspective
)
{
configObject
.
perspective
=
widget
.
perspective
;
}
return
{
return
{
id
:
widget
.
widgetId
,
id
:
widget
.
widgetId
,
...
@@ -385,7 +382,10 @@ export class DashboardManagementComponent implements OnInit {
...
@@ -385,7 +382,10 @@ export class DashboardManagementComponent implements OnInit {
row
:
widget
.
y
,
row
:
widget
.
y
,
col
:
widget
.
x
,
col
:
widget
.
x
,
componentType
:
this
.
widgetComponentMap
[
widget
.
component
],
componentType
:
this
.
widgetComponentMap
[
widget
.
component
],
componentInputs
:
{
config
:
configObject
},
componentInputs
:
{
config
:
configObject
,
perspective
:
widget
.
perspective
},
originalWidget
:
widget
originalWidget
:
widget
};
};
});
});
...
...
src/app/portal-manage/widgets/base-widget.component.ts
View file @
112d869e
...
@@ -5,6 +5,7 @@ import { DashboardStateService, SelectedDataset } from '../services/dashboard-st
...
@@ -5,6 +5,7 @@ import { DashboardStateService, SelectedDataset } from '../services/dashboard-st
@
Directive
()
// Use @Directive() for base classes without their own template
@
Directive
()
// Use @Directive() for base classes without their own template
export
abstract
class
BaseWidgetComponent
implements
OnInit
,
OnDestroy
{
export
abstract
class
BaseWidgetComponent
implements
OnInit
,
OnDestroy
{
@
Input
()
config
:
any
;
@
Input
()
config
:
any
;
@
Input
()
perspective
:
string
|
null
=
null
;
public
title
:
string
;
public
title
:
string
;
public
isLoading
=
true
;
public
isLoading
=
true
;
...
...
src/app/portal-manage/widgets/syncfusion-datagrid-widget/syncfusion-datagrid-widget.component.html
View file @
112d869e
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
[
columnMenuItems
]="
columnMenuItems
"
[
columnMenuItems
]="
columnMenuItems
"
(
columnMenuClick
)="
onColumnMenuClick
($
event
)"
(
columnMenuClick
)="
onColumnMenuClick
($
event
)"
(
actionComplete
)="
actionComplete
($
event
)"
(
actionComplete
)="
actionComplete
($
event
)"
(
dataBound
)="
onDataBound
($
event
)"
height=
"100%"
>
height=
"100%"
>
<e-columns>
<e-columns>
<e-column
*
ngFor=
"let col of columns"
[
field
]="
col
.
field
"
[
headerText
]="
col
.
headerText
"
[
width
]="
col
.
width
"
<e-column
*
ngFor=
"let col of columns"
[
field
]="
col
.
field
"
[
headerText
]="
col
.
headerText
"
[
width
]="
col
.
width
"
...
...
src/app/portal-manage/widgets/syncfusion-datagrid-widget/syncfusion-datagrid-widget.component.ts
View file @
112d869e
...
@@ -59,6 +59,7 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
...
@@ -59,6 +59,7 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
@
ViewChild
(
'grid'
)
public
grid
:
GridComponent
;
@
ViewChild
(
'grid'
)
public
grid
:
GridComponent
;
public
widgetId
:
string
;
// Added widgetId property
public
widgetId
:
string
;
// Added widgetId property
private
isPerspectiveApplied
=
false
;
public
data
:
DataManager
=
new
DataManager
([]);
public
data
:
DataManager
=
new
DataManager
([]);
public
columns
:
any
[]
=
[];
public
columns
:
any
[]
=
[];
...
@@ -104,11 +105,7 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
...
@@ -104,11 +105,7 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
}
}
ngAfterViewInit
():
void
{
ngAfterViewInit
():
void
{
// Apply saved perspective if available
// Perspective is now applied in onDataUpdate to ensure data is present.
// We do this in AfterViewInit to ensure the @ViewChild('grid') is available.
if
(
this
.
config
.
perspective
)
{
this
.
setWidgetState
(
this
.
config
.
perspective
);
}
}
}
applyInitialConfig
():
void
{
applyInitialConfig
():
void
{
...
@@ -163,7 +160,8 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
...
@@ -163,7 +160,8 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
if
(
this
.
grid
&&
state
&&
state
!==
'{}'
)
{
if
(
this
.
grid
&&
state
&&
state
!==
'{}'
)
{
try
{
try
{
const
stateObj
=
JSON
.
parse
(
state
);
const
stateObj
=
JSON
.
parse
(
state
);
(
this
.
grid
as
any
).
setPersistData
(
stateObj
);
// Pass object instead of string
this
.
grid
.
setProperties
(
stateObj
);
this
.
isPerspectiveApplied
=
true
;
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
"Error parsing perspective state for grid:"
,
e
);
console
.
error
(
"Error parsing perspective state for grid:"
,
e
);
}
}
...
@@ -183,6 +181,13 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
...
@@ -183,6 +181,13 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
}
}
}
}
onDataBound
(
args
:
any
):
void
{
// Apply perspective after data is loaded and rendered, but only once.
if
(
this
.
perspective
&&
!
this
.
isPerspectiveApplied
)
{
this
.
setWidgetState
(
this
.
perspective
as
string
);
}
}
onReset
():
void
{
onReset
():
void
{
this
.
title
=
'Data Grid (Default)'
;
this
.
title
=
'Data Grid (Default)'
;
this
.
data
=
new
DataManager
([]);
this
.
data
=
new
DataManager
([]);
...
...
src/app/portal-manage/widgets/syncfusion-pivot-widget/syncfusion-pivot-widget.component.html
View file @
112d869e
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
[
toolbar
]="
toolbar
"
[
toolbar
]="
toolbar
"
[
displayOption
]="
displayOption
"
[
displayOption
]="
displayOption
"
[
chartSettings
]="
chartSettings
"
[
chartSettings
]="
chartSettings
"
(
dataBound
)="
onDataBound
($
event
)"
height=
"100%"
>
height=
"100%"
>
</ejs-pivotview>
</ejs-pivotview>
...
...
src/app/portal-manage/widgets/syncfusion-pivot-widget/syncfusion-pivot-widget.component.ts
View file @
112d869e
...
@@ -19,6 +19,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -19,6 +19,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
@
ViewChild
(
'pivotview'
)
public
pivotview
:
PivotViewComponent
;
@
ViewChild
(
'pivotview'
)
public
pivotview
:
PivotViewComponent
;
public
widgetId
:
string
;
public
widgetId
:
string
;
private
isPerspectiveApplied
=
false
;
public
dataSourceSettings
:
{
public
dataSourceSettings
:
{
dataSource
:
DataManager
;
dataSource
:
DataManager
;
...
@@ -65,11 +66,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -65,11 +66,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
}
}
ngAfterViewInit
():
void
{
ngAfterViewInit
():
void
{
// Apply saved perspective if available
// Perspective is now applied in onDataUpdate to ensure data is present.
// We do this in AfterViewInit to ensure the @ViewChild('pivotview') is available.
if
(
this
.
config
.
perspective
)
{
this
.
setWidgetState
(
this
.
config
.
perspective
);
}
}
}
applyInitialConfig
():
void
{
applyInitialConfig
():
void
{
...
@@ -116,6 +113,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -116,6 +113,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
if
(
this
.
pivotview
)
{
if
(
this
.
pivotview
)
{
this
.
pivotview
.
dataSourceSettings
=
this
.
dataSourceSettings
;
this
.
pivotview
.
dataSourceSettings
=
this
.
dataSourceSettings
;
}
}
this
.
isPerspectiveApplied
=
true
;
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
'Error applying pivot perspective state:'
,
e
);
console
.
error
(
'Error applying pivot perspective state:'
,
e
);
}
}
...
@@ -129,7 +127,17 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
...
@@ -129,7 +127,17 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
};
};
if
(
this
.
pivotview
)
{
if
(
this
.
pivotview
)
{
this
.
pivotview
.
dataSourceSettings
.
dataSource
=
new
DataManager
(
data
);
this
.
pivotview
.
dataSourceSettings
.
dataSource
=
new
DataManager
(
data
);
this
.
pivotview
.
refresh
();
// The refresh is implicitly handled by the dataBound event now
}
}
onDataBound
(
args
:
any
):
void
{
if
(
this
.
pivotview
)
{
this
.
pivotview
.
refresh
();
}
// Apply perspective after data is loaded and rendered, but only once.
if
(
this
.
perspective
&&
!
this
.
isPerspectiveApplied
)
{
this
.
setWidgetState
(
this
.
perspective
as
string
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment