I'm facing a problem I don't know how to resolve.
I created a favourite tab containing all the characters the user saved.
In the favourite page it displays the tab.
The user can remove an item from his favourite by clicking on the top icon heart.
It works perfectly, the item is instantly removed but if I'm on the second page, and remove all the items from the page, I get a blank screen even if the pagination updates accordly (from 2 pages to 1).
I have to refresh manually the page so that it show the remaining items.
How can I force to refresh the page automatically ?
You can see on the image that when the item is deleted, the page 2 is deleted but I'm still on the deleted page (the 1 on pagination is not bold).
Related
when deleted an item form the user interface working in react and mongodb, the item is deleted form mongodb but not showing on the user interface. when reload the page then the item is gone, without reload page how to remove the item from user interface.
I have created a page where there are 2 section (2 controllers and 2 views).
The section in the left has categories (category_selector), and the section on the right displays items in the category that was selected in the left section (category_item_display).
There are many items in a single category, so pagination is implemented in category_item_display.
Pagination works by loading 20 items and then shows a button 'Show More' if there are more items in the category. Clicking the button will add another 20 items to the page.
When an item is clicked, the page is changed to item details page and the item details are displayed.
Now here is the problem.If I click on 'Show More' button once or more, then more than 20 items are displayed in category_item_display. But once I navigate to item details page and then click back button, again the controller loads and shows only 20 items in category_item_display.
So what I did was that the number of items to be loaded is checked from a URL parameter 'loaded_items' first, and if not found then default 20 is picked.
A URL search parameter 'loaded_items=' is added to the address when an item is clicked, and then the address is changed. I did this by having both ng-ref and ng-click on the anchor element, so that ng-click will execute first which has $location.search('loaded_items', count);
I did not want to store the loaded items count in the URL as soon as 'Show More' is clicked, because if I select another category the loaded items will be as per this count.
I want to remove the URL parameter 'loaded_items' on controller init after recording the value somewhere so that the list can be retrieved. But $location.search('loaded_items', null); is reloading the page again and hence the loaded items seems to be items loaded repeated twice.
How can I achieve this?
Thanks in advance
Balu
As told by jbrown, I added the items to the service. Along with it,
ng-click call back will add the selected item id to the service. Now
when I click back button, the item list will be unaltered because it
is in the service. Using $anchorScroll in $timeout, the screen can be
scrolled to the exact item (using id) that was selected.
Thanks everyone.
I have a List with default pagination. Each entry in the List can be deleted using the Delete button. The Delete button is the admin-on-rest Delete. Clicking Delete button takes me to a new page where the user is asked to confirm the action. On confirm, the user is redirected back to the page the item was on, so if the item was on page 2 of the list, they are redirected back to page 2 after the confirmation. This is the default behaviour of the admin-on-rest Delete.
The problem is, if page 2 has only one item and it is deleted, it redirects me to page 2 with an empty table and no arrows to navigate to first page. I have to do a browser refresh to fix it.
I noticed that in admin-on-rest version 1.3.3 there is a prop called "redirect" that the Delete accepts. I can set the redirect path of the previous page if the the row to be deleted is the only row on the page. But I cant figure out how to get the number of rows on the page. The admin-on-rest List component does not expose the pagination component which keeps information about the current page like page number, rows in the page etc.
Has anyone else had this issue? How do I get around it?
I have 2 angular pages
Load page 1 which shows a big table of stuff, set some filters to find what you want, click the row in the table to get more details (loads page 2 which provides details).
From page 2, Press back button, page 1 loads from scratch, without the filter the user entered
Is there a way to preserve the filter the user has set when he goes back to page1? Is there a way I can keep the table where it was (e.g., if the user has scrolled halfway down, it returns where he was, rather than to the top of the table)
I could do this manually (pass the filter to the details page, then pass it back when user hits and scroll him back to where he was in the table), but this feels painful.
I have a web page done in AngularJS. I got four tabs. In my first tab there are a set of images which I can select,
When i switch between tabs,and come back to the first page, the page gets refreshed and I loose what ever I have done in my 1st tab. Like tab gets refreshed like it was loaded again.In this 1st tab I got some drill downs ass well. That also gets reset.
How can I avoid this.