Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 2, 2025. It is now read-only.
Discussion options

I have a function generateData(), which will generate the data for table oninit, i want to rerender the table and run the function again and apply the new data generated to the table. I tried rerender in the page but not working,
this is how i generate data in function and trigger

this.tempSlotData.forEach((slot: any) => { const d = new Date(slot.date); const day = d.toISOString().split('T')[0]; const data = { slot_id: slot._id, rev: slot._rev, date: day, token: slot.token_number, fullname: slot.user_name, phone: slot.user_phone, email: slot.user_email, time: slot.slot, lane: slot.lane_name, lane_id: slot.lane_id, group: slot.group_name, group_id: slot.group_id, status: slot.booking_status, additional_details: slot.additional_details }; this.allSlotData.push(data); }); this.dtTrigger.next(this.allSlotData);

and this is how i rerender the data

this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => { // Destroy the table first dtInstance.destroy(); // this.generateSlotData(this.provider) // Call the dtTrigger to rerender again this.dtTrigger.next(this.allSlotData); });

this will rerender the same data with local updates only, how do I rerender the table with the new set of data with the data generating function?

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

Hi, can you provide a small reproducible repo to investigate this?

You must be logged in to vote
1 reply
@nizalsha
Comment options

i will try to produce repo, but Can you tell why this error is happening

ERROR ObjectUnsubscribedErrorImpl {stack: 'Error\n at _super (http://localhost:4200/vendor.…r.next (http://localhost:4200/vendor.js:20245:12)', name: 'ObjectUnsubscribedError', message: 'object unsubscribed'}message: "object unsubscribed"name: "ObjectUnsubscribedError"stack: "Error\n at _super (http://localhost:4200/vendor.js:24148:22)\n at new ObjectUnsubscribedErrorImpl (http://localhost:4200/vendor.js:23977:3)\n at Subject._throwIfClosed (http://localhost:4200/vendor.js:20032:13)\n at http://localhost:4200/vendor.js:20038:12\n at errorContext (http://localhost:4200/vendor.js:24216:5)\n at Subject.next (http://localhost:4200/vendor.js:20037:69)\n at Object.next (http://localhost:4200/main.js:2340:40)\n at ConsumerObserver.next (http://localhost:4200/vendor.js:20316:25)\n at SafeSubscriber._next (http://localhost:4200/vendor.js:20278:22)\n at SafeSubscriber.next (http://localhost:4200/vendor.js:20245:12)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.