l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.58k stars 486 forks source link

it's working server side pagination only in angular-datatable document urls, if we give any new url doesn't work serverside pagination, what can i do please? #1624

Closed vardhan1122 closed 2 years ago

vardhan1122 commented 2 years ago

const that = this; this.dtOptions = { pagingType: 'full_numbers', pageLength: 2, lengthMenu: [2,4,6,8], serverSide: true, processing: true, ajax: (dataTablesParameters: any, callback) => { that.http.post( https://gist.githubusercontent.com/vardhan1122/09f13a829535a480febd5069e90abab3/raw/765ed7fe28f7baede135dc060fc36dc6ec225969/emp-names.json, dataTablesParameters,{} ).subscribe(resp => { that.persons = resp.data; callback({ recordsTotal: resp.recordsTotal, recordsFiltered: resp.recordsFiltered, data: [] }); }); }, columns: [{ data: 'id' }, { data: 'firstName' }, { data: 'lastName' }] };

shanmukhateja commented 2 years ago

Hi,

Please provide a StackBlitz link or GitHub repo to investigate.

vardhan1122 commented 2 years ago

Hi Mr. Surya Teja, Good Morning.,

Just add below url in our server side documentation,and observer it , doesn't work https://gist.githubusercontent.com/vardhan1122/09f13a829535a480febd5069e90abab3/raw/765ed7fe28f7baede135dc060fc36dc6ec225969/emp-names.json

Sincerely Thanks, Vardhan

On Thu, Dec 2, 2021 at 8:48 PM Surya Teja K @.***> wrote:

Hi,

Please provide a StackBlitz link or GitHub repo to investigate.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/l-lin/angular-datatables/issues/1624#issuecomment-984724799, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAMX6A6KSSE6DYNBNUX2ATUO6E5XANCNFSM5JGNEWOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

shanmukhateja commented 2 years ago

Hi,

This is a CORS issue. You need to use a different server that handles CORS requests properly.

Access to XMLHttpRequest at 'https://gist.githubusercontent.com/vardhan1122/09f13a829535a480febd5069e90abab3/raw/765ed7fe28f7baede135dc060fc36dc6ec225969/emp-names.json' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

This isn't a library issue. Closing now.