Welcome Guest, Not a member yet? Register   Sign In
Quick Question!
#1

[eluser]SteveBluck[/eluser]
Is it possible to automatically refresh the page after a view is loaded?

The reason I ask is because say for example in one view I deleted some database fields and then loaded up a view displaying the updated fields. It will NOT show the updated content until I refresh.

Is there a way to fix this?

Thank you!
#2

[eluser]Clooner[/eluser]
Quick answer: Yes! Use Ajax
#3

[eluser]Michael Wales[/eluser]
This merely sounds like a browsing caching issue.

If I have a series of records, each with a checkbox, I click on all the little checkboxes, hit a delete button. That form self-submits to the same controller/method that displayed the list of results, runs some validation processes, sends the delete action to the model, then redirects to the controller/method again (to display the list of results), that new view should only show what exists in the database at that time.

Code:
function view() {
  $this->load->library('form_validation');

  if ($this->form_validation->run()) {
    // Make a call to the model's delete action for each of the selected checkboxes
    redirect('controller/view');
    return;
  }
  // Make a call to the model to retrieve all records - place in $data var
  $this->load->view('records/edit', $data);
}

Maybe a more detailed explanation of exactly what is wrong is in order...
#4

[eluser]SteveBluck[/eluser]
Hmm, so instead of loading a view - I'll do a redirect instead. I never actually though of that, I'm gonna give it ago and let you know.

@ Michael Wales - you are spot on with the explanation, what you've done is what I'm trying to accomplish.
#5

[eluser]SteveBluck[/eluser]
Worked like a charm, thank you very much.




Theme © iAndrew 2016 - Forum software by © MyBB