⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Auto-scrolling list view



jgalak1

jgalak1
  • profile picture
  • Member

Posted 15 October 2017 - 13:49 PM

I have a Grocery Crud instance running that has a custom action button using add_action.  It uses the link_url to fire off a function that does some stuff to the data in that row, and then the function redirects back to the list view.  Specifically, the action removes the row from the view (not deleted, just tagged so it no longer matches the relevant "WHERE" clause).

 

Problem is, when the redirect occurs, it jumps back to the top of the page, which is annoying, since the list view is often long (I have it set for 100 rows at the moment), and worse yet, to the first page.  

 

Is there any way to have it jump back to where the user was before he clicked the button?  Note that it can't search by the primary id since the row is no longer displayed after the button is clicked.....


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 17 October 2017 - 09:30 AM

well.. there is a simpler solution to your problem,

 

there is a refresh button on the theme.... (dont know what theme u using ..)..but for example, the Flexigrid theme have a refresh button on the bottom..

the same is being allotted a class - pReload

Now instead of redirecting it back to the same controller - u can simple use the following piece of code.. 

$(".pReload").trigger('click');

 

technically what i mean to say is.. programmatically trigger the refresh / reload button and it will reload the data on the same page.. this should sort your purpose..

 

Happy GCIng :)


kajues

kajues
  • profile picture
  • Member

Posted 17 October 2017 - 18:56 PM

Hello Sir Amit, i have a few questions. You hace more experience, but i never received any answer of this group... Plz can you help me? If you can. I would like to talk u, via skype if you want, or hangout, whatsapp,...  :lol:  sorry for writing in this post.


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 18 October 2017 - 04:20 AM

$(".ajax_refresh_and_loading").trigger("click");

 

this 1 u can use... instead of earlier


OceanDean

OceanDean
  • profile picture
  • Member

Posted 29 October 2020 - 00:15 AM

I don`t know what happened further, but you`d better be more awared with whatsapp,because people already can use whatsapp spy tools to watch for you data and sell to YOU in return,lol 
You know how it works! 
But as every soft, it has another side of medal - you can watch for your old parents or kids.. 
​Hard world