DevExpress 商业智能仪表板实时网格:我们如何突出显示最近更新的单元格

问题描述 投票:0回答:0

我有一个包含单个网格的 dev express 仪表板。使用 Init 方法,我将在几秒钟后更新网格数据。

要求高亮最近更新的单元格。如下。

PFB 代码渲染网格。 ASPX代码:

<body>
<form id="form1" runat="server">
    <div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
        <dx:ASPxDashboard
            ID="ASPxDashboard1"
            runat="server" Width="100%" Height="100%"
            ClientInstanceName="db"
            WorkingMode="ViewerOnly"
            UseDashboardConfigurator="True"
            OnDashboardLoading="ASPxDashboard1_DashboardLoading" 
            ColorScheme="material.blue.light.compact">
            <ClientSideEvents
                BeforeRender="onBeforeRender"
                Init="onInit" />
        </dx:ASPxDashboard>
    </div>
</form>

xml:

<Grid ComponentName="gridDashboardItem1" Name="Sample" DataSource="dashboardSqlDataSource1" DataMember="Products">
  <DataItems>
    <Dimension DataMember="UnitPrice" DefaultId="DataItem2" />
    <Dimension DataMember="UnitsInStock" DefaultId="DataItem3" />
    <Dimension DataMember="ProductName" DefaultId="DataItem1" />
    <Dimension DataMember="ProductID" DefaultId="DataItem0" />
  </DataItems>
     <GridColumns>
    <GridDimensionColumn>
      <Dimension DefaultId="DataItem0" />
    </GridDimensionColumn>
    <GridDimensionColumn>
      <Dimension DefaultId="DataItem1" />
    </GridDimensionColumn>
    <GridDimensionColumn>
      <Dimension DefaultId="DataItem2" />
    </GridDimensionColumn>
    <GridDimensionColumn>
      <Dimension DefaultId="DataItem3" />
    </GridDimensionColumn>
  </GridColumns>
  <GridOptions />
  <ColumnFilterOptions />
</Grid>

脚本:

<script type="text/javascript">
    var dashboardControl;
    var viewerApi;

    function onBeforeRender(sender) {
        dashboardControl = sender.GetDashboardControl();
        viewerApi = dashboardControl.findExtension('viewerApi');

        if (viewerApi) {
            //
        }
    }

    function onInit() {
        setInterval(refresh, 1000); // 2 min
    }

    function refresh() {
        dashboardControl.refresh(['gridDashboardItem1']);
    }

</script>

提前谢谢你。

asp.net devexpress devexpress-mvc
© www.soinside.com 2019 - 2024. All rights reserved.