Following last week, I continue the implementation of the stock take. This week, I implemented functions, struggled with some logic, and modified the list component, among other things.
First, after successfully retrieving the data of the item list in the detail view, various tasks remained. Such as the search and pagination functions in both views. I added pagination and the possibility to search by barcode or item name to the list view. The data size was restricted by the API call, thus this was a fairly straightforward process.
Next, I was tasked with developing a specific search feature for the detail view. This search is not intended to filter the data, but rather to navigate to the page containing the item. This is where I ran into trouble creating the pagination this time because the Flatlist component did not make it easy. Mr. Peter then suggested I replace the Flatlist component used for the data table with the DataTable component.
Last, after implementing the Datatable component, I was finally able to view the data. I encountered one obstacle, which is pagination, but I was able to overcome it by separating the data into chunks and mapping the values between the first and last index in each chunk to the list. In the coming week, I must complete the search feature and carry on to next tasks.
