|
. . .
import { L10n } from '@syncfusion/ej2-base';
. . .
// initially applying the display message as per requirement
L10n.load({
'en-US': {
'grid': {
'EmptyRecord': 'Loading the data',
}
}
});
export class RemoteDataBinding extends SampleBase {
constructor() {
super(...arguments);
this.hostUrl = 'https://ej2services.syncfusion.com/production/web-services/';
this.data = new DataManager({ url: this.hostUrl + 'api/Orders', adaptor: new WebApiAdaptor });
}
dataBound (args) {
var emptyRow = document.querySelector('.e-emptyrow');
if (emptyRow)
{
// changing the message as default once data is loaded
emptyRow.cells[0].innerText = "No records to display"
}
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<GridComponent id="Grid" dataSource={this.data} dataBound={this.dataBound.bind(this)}
<ColumnsDirective>
. . .
</ColumnsDirective>
<Inject services={[Page]}/>
</GridComponent>
</div>
<div id='waitingpopup' className='waitingpopup'>
<span id='gif' className='image'></span>
</div>
</div>);
}
}
render(<RemoteDataBinding />, document.getElementById('sample')); |