last day (20 days later) » 

10:23 AM
1
A: Data source is not executed in ag grid

PankajTry the following code, taking reference form https://www.ag-grid.com/example-angular-dynamic/#dynamic&gsc.tab=0 dataSource will have a callback which will render the data on grid. this.gridOptions.api.setRowData(data); is responsible to refresh the grid data. And the method which does AJAX, it...

 
searchIncident will make the server call as it is ?.. I had updated my code can u please give me some hint
applied this code, getting error caused by: Cannot read property 'setRowData' of undefined
 
the above code is having rough parts in form of methods, you would need to add them at their respective positions
 
I have added, I can see the pagination now.. but initially its loading two times. and each next button it shows previously loaded data.
 
in searchIncident method, I have changed the startRow to a logic which will give new start offset every time button is clicked. Also note the page variable added below gridOptions
 
How to fix this error "caused by: Cannot read property 'setRowData' of undefined" : Implemented the changes
 
10:23 AM
I won't be able to tell you until I see the error in action. Can you provide any JS fiddle or similar? You can use jsonplaceholder.typicode.com for sample data.
 
adding JSfiddle for angular2 is difficult. I can give you the complete ts file. Can you help me in adding fiddle ?
Is there any JSfiddle for ag grid angular js2 (type script) with server side pagination. ? . I had invoke grid after clicking the search button. Also, when this data source get invoked ?
Hi Pankaj\
now grid itself is not loading
 
if you have any repository, I can directly have a look
 
private searchIncidents() {
this.dataSource.getRows({
startRow: (this.page - 1) * this.dataSource.pageSize,
successCallback: (data: any) =>{
this.gridOptions.api.setRowData(data);
}
});
}.. giving error caused by: Cannot read property 'setRowData' of undefined
any idea ?
 
private searchIncidents() {
this.dataSource.getRows({
startRow: (this.page - 1) * this.dataSource.pageSize,
successCallback: (data: any) =>{
console.log(this.gridOptions.api);
this.gridOptions.api.setRowData(data);
}
});
try this one
it has a console.log for gridOptions.api
 
undefined
 
10:28 AM
console.log(this.gridOptions) on same position?
 
yes
one min
it returns object
 
can you expand it and see what keys are there in that object? or copy all after expanding
 
{"context":}]},"rowModelType":"pagination","enableServerSideFilter":true,"pagina‌​tionPageSize":10}
I removed some code
its too long
u got any hint ?
 
wait I am creating a plunkr url, you can add code over there
 
10:39 AM
try to edit the files over here
 
ok
i dont have permission
to save
updated that
 
10:57 AM
u need any more details ?
Pankaj r u there?
 
yes
trying to come up with working solution
wait
 
ok
thanks
 
 
2 hours later…
12:51 PM
This is what I came up with, little working
just press the button
on the review
 
 
4 hours later…
5:19 PM
pankaj
what is this
:(
 

  last day (20 days later) »