Я создаю сводную таблицу с использованием TreeGrid, но она не читает никаких данных из мастер-таблицы - PullRequest
0 голосов
/ 22 марта 2020

Я использую каркас TreeGrid в Angular для создания Сводной таблицы , которая считывает данные из главной таблицы. Основная таблица считывает данные с сервера. Данные передаются с сервера на мастер таблица , но не из основной таблицы в сводную таблицу

Отображается ошибка «Данные не найдены»

Мой код выглядит следующим образом:

Html:

<div class="Border">

<div  class="Main" style="width:100%;height:530px;">
      <treegrid  Debug='check'
         Layout_Url="Layouts/TableDef.js"
         Data_Url="http://127.0.0.1:8080/one"
         Upload_Url="http://127.0.0.1:8080/send"
         Upload_Type = "Data"
         Upload_Format = "JSON"
         hidden="0"></treegrid> 
</div>

<div class="Main" style="width:100%;height:530px;" >
      <treegrid Debug='check'   Layout_Url="Layouts/PivotDef.xml"></treegrid>
</div>

</div>

PivotDef. xml

    <!-- Structure definition for the pivot table, its data are created automatically from the Cars table according to the pivot settings -->
    <Grid>
       <Cfg id="Pivot" PivotMaster="Data1" SuppressCfg="0"/> <!-- Base definition, saves configuration to cookies -->
       <Cfg Size="Low"/> <!-- Smaller size for large grid -->
       <Cfg ConstWidth="800" MaxHeight="1" MinTagHeight="400"/> <!-- Size settings just for the example. Maximizes the grid height. -->
       <Cfg PivotCols="name,Age" PivotRows="name,Age" PivotData="name,Age"/> <!-- Initial pivot settings, let them empty to start with master grid instead of pivot -->

       <Cfg PivotShowParent="1"/> <!-- Shows summary columns by default -->
       <Cfg MenuColumnsCount="3"/> <!-- Shows columns menu and print menu in three columns, because there can be many column in grid -->
       <Cfg PivotFilter="0"/> <!-- If the pivot will use rows hidden by filter, 0 = no -->
       <Cfg PivotExpanded="2,5"/> <!-- Sets expanded level for columns and rows -->

    </Grid> 

TableDef. js

  {
    Cfg: { // Cfg tag is splitted by attributes just for comments, you should merge them in your 
 standard applications
       id:"Data1", // Grid identification for saving configuration to cookies
       CfgId:"Data1",
       //Paging:'2', ChildPaging:'2', // Both paging set to client
       PageLength:'21', // count of rows at one page
       SaveSession:'1', // Stores IO Session to cookies to identify the client on server and access appropriate grid instance
       ShowDeleted:'0', // This example hides deleted row instead of coloring them red
       MaxHeight:'1', MinTagHeight:'400', // Grid maximizes height of the main tag on page
       IdChars:'0123456789', NumberId:'1', // row ids are set by numbers
       //Sort:'Project,Resource', // To sort grid according to Project and Resource for first time (when no configuration saved)
       GroupMain:'Project', // Shows grouping tree in column Project
       Dragging:'0', // In this example is dragging not permitted
       UsePrefix:'1',// Uses prefix (GS,GL,GO,GM,GB,GP,GR) for custom class names to support all style
       Alternate:'3', // Custom style setting, every third row will have different color
       ReloadChanged:'3' // Asks when reloading and there are pending changes
       },
    Actions: {
       OnRightClickCell:'Grid.Component.showCustomMenu(Row,Col)' // Custom event handler, shows the calling method of the framework component; Shows some custom popup menu on right click to any cell
       },
Cols: [

   { Name:'name', Width:'250', Type:'Text' },
   { Name:'Age', Width:'130', Type:'Text' },

   ],
Def: {
   Group: {  // Default row for grouping, calculates summary for its group
      ProjectVisible:'0', ResourceVisible:'0', AggChildren:'1', Calculated:'1',
      WeekFormula:'min()+"-"+max()', WeekType:'Text', WeekClassInner:'Number', HoursFormula:'sum()'
      }
   },
Header: { id:'id' }
/*Head: [
   { Kind:'Filter', idVisible:'0' }, // Filter row
   { Kind:'Group', Space:'1', Panel:'1', // Grouping row
      Cells:'List,Custom',
      List:'|Group by none|Group by Project|Group by Resource|Group by Project -> Resource',
      ListCustom:'Custom grouping',
      ListWidth:'180',
      Cols:'||Project|Resource|Project,Resource'
      }
   ],*/

//,Pager: { Width:'0' } // Right side pager
}
...