【问题标题】:Associate the chart and table in devextreme在 devextreme 中关联图表和表格
【发布时间】:2019-02-14 07:41:35
【问题描述】:

我想在 devextreme 中关联表格和图表。我想过滤图表也过滤表格。 你能帮帮我吗?

【问题讨论】:

    标签: mongodb charts datagrid mean-stack devextreme


    【解决方案1】:

    您可以通过使用相关数据源的过滤选项来实现这一点

    function chartFilter(ChartInstance, ChartKey, KeyValue, ReloadChartsFunc) {
    
    /*
       ChartInstance = Instance of devExtreme Chart
       ChartKey = filter by ChartKey Field 
       KeyValue = value of ChartKey
       ReloadChartsFunc = Callback function to execute once filter the ds
    */
    
    
    
    var searchOperator = "<>";
    if (KeyValue != "")
        searchOperator = psChart.option("quickSearchOption");
    
    
    var ds = ChartInstance.getDataSource();
    ds.filter(ChartKey, searchOperator, KeyValue);
    
    
    ds.load().done(function (result) {
    
     if (ReloadChartsFunc != undefined && result[0] != undefined && result[0] != null) {
    
         ReloadChartsFunc(result[0])
     }
     });
    
    }
    

    你可以根据自己的需要对上面的代码做任何你想做的修改。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-24
      • 1970-01-01
      • 2021-12-26
      • 1970-01-01
      • 2021-10-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多