I tried to use the new ability 'Adaptive view' for the grid component but when I updated my version of one from '18.2.59' to '19.1.69' something went wrong, I'm getting the error 'Uncaught TypeError: Cannot read property 'getPanel' of null` in an infinity loop.
How can I use a new version of the grid?
An old version of the grid works fine, but the new version throwing errors without making changes.
Index.js
render() {
return (
<div className="control-pane">
<div className="control-section">
<div className="col-md-9 e-bigger e-adaptive-demo">
{!Browser.isDevice ? (
<div className="e-mobile-layout">
<div className="e-mobile-content">
<GridComponent
id="adaptivebrowser"
dataSource={this.data}
height="100%"
ref={grid => (this.grid = grid)}
enableAdaptiveUI={true}
rowRenderingMode={this.renderingMode}
allowFiltering={true}
allowSorting={true}
allowPaging={true}
filterSettings={this.filterOptions}
toolbar={this.toolbarOptions}
editSettings={this.editSettings}
pageSettings={{ pageCount: 3 }}
load={this.load}
>
<ColumnsDirective>
<ColumnDirective
field="OrderID"
headerText="Order ID"
width="180"
isPrimaryKey={true}
validationRules={this.orderidRules}
/>
<ColumnDirective
field="Freight"
headerText="Freight"
width="180"
format="C2"
editType="numericedit"
validationRules={this.validationRule}
/>
<ColumnDirective
field="CustomerName"
headerText="Name"
width="180"
validationRules={this.validationRule}
/>
<ColumnDirective
field="ShipCountry"
headerText="Ship Country"
width="180"
/>
</ColumnsDirective>
<AggregatesDirective>
<AggregateDirective>
<AggregateColumnsDirective>
<AggregateColumnDirective
field="Freight"
type="Sum"
format="C2"
footerTemplate={this.footerSum}
>
{' '}
</AggregateColumnDirective>
</AggregateColumnsDirective>
</AggregateDirective>
</AggregatesDirective>
<Inject
services={[Filter, Sort, Edit, Toolbar, Aggregate, Page]}
/>
</GridComponent>
</div>
</div>
) : (
<GridComponent
id="adaptivedevice"
dataSource={data}
height="100%"
ref={grid => (this.grid = grid)}
enableAdaptiveUI={true}
rowRenderingMode={this.renderingMode}
allowFiltering={true}
allowSorting={true}
allowPaging={true}
filterSettings={this.filterOptions}
toolbar={this.toolbarOptions}
editSettings={this.editSettings}
pageSettings={{ pageCount: 3 }}
load={this.load}
>
<ColumnsDirective>
<ColumnDirective
field="OrderID"
headerText="Order ID"
width="180"
isPrimaryKey={true}
validationRules={this.orderidRules}
/>
<ColumnDirective
field="Freight"
headerText="Freight"
width="180"
format="C2"
editType="numericedit"
validationRules={this.validationRule}
/>
<ColumnDirective
field="CustomerName"
headerText="Name"
width="180"
validationRules={this.validationRule}
/>
<ColumnDirective
field="ShipCountry"
headerText="Ship Country"
width="180"
/>
</ColumnsDirective>
<AggregatesDirective>
<AggregateDirective>
<AggregateColumnsDirective>
<AggregateColumnDirective
field="Freight"
type="Sum"
format="C2"
footerTemplate={this.footerSum}
>
{' '}
</AggregateColumnDirective>
</AggregateColumnsDirective>
</AggregateDirective>
</AggregatesDirective>
<Inject
services={[Filter, Sort, Edit, Toolbar, Aggregate, Page]}
/>
</GridComponent>
)}
</div>
<div className="col-md-3 property-section">
<PropertyPane title="Properties">
<table
id="property"
title="Properties"
className="property-panel-table"
style={{ width: '100%', marginBottom: '20px' }}
>
<tr>
<td>
<div>Enable horizontal row mode</div>
</td>
<td>
<div>
<CheckBoxComponent
ref={scope => {
this.checkboxObj = scope;
}}
change={this.onChange.bind(this)}
/>
</div>
</td>
</tr>
</table>
</PropertyPane>
</div>
</div>
</div>
);
}
}
render(<Adaptive />, document.getElementById('sample'));
|
Hello, thanks for the suggestion. I found an issue. The main problem I am trying to implement custom sorting without a provider that's why I'm passing dataSource as an object with `result` key. But why component throwing issues in the infinite loop I didn't realize. Could you explain me?
3. Attached video to this message.
4. No.
5. What do u mean by 'remote data'? Data that I'm getting from any API? If so, yes, I'm getting data from API then saving it to store.
and throw data without this wrapper we will have no rerender issue but our custom sorting will not work, so I need some solution how to implement the same things in the new version of grid.