function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vanitha ManiVanitha Mani 

Lightning datatable--Date

Hi,

I have a lightning datatable where I need to have two labels previous month and next month .How to achieve that ?
And also I need to display previous month data in previous month column and next month data in next month column from same object X1.

Can anyone help me how to achieve this

Thanks,

VM
mukesh guptamukesh gupta
Hi Vanitha,

For this approach you need to Add 2 buttons on LWC Component

PREVIOUS MONTH                     NEXT MONTH    


Initally DataTable will load all records by onLoad methods call By Apex class and will display in DataTable

Now you need to use Click Event on both button , this button will check what is previous  or next months in javascript controller and will send month name to apex class, this apex class will return only relevent months records in datatable.


if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 

 
Vanitha ManiVanitha Mani
I am using aura component and not LWC.Can u help me how to do using aura