reloadGrid using PHP/AJAX

QuestionsreloadGrid using PHP/AJAX
Craig asked 7 years ago

Hi there,

I've been scouring the web looking for an answer to this as I can't seem to make it work properly and not sure if I've read the docco correctly so I'm after some clarification please.

I'm using CodeIgniter 3.0.4 and have successfully integrated phpGrid and it's working well. I load the data to an array in the PHP controller and use $h->table = $myArray to populate the data.

I'm doing some AJAX add/update/delete methods in jQuery to prevent the multiple page reloads on each operation and I'm currently hunting for how to reload/refresh the data from the server.

I've tried $('#grid').trigger('reloadGrid', { fromServer: true, page: 1 }); but this doesn't appear to do anything at all – which I'm not surprised about due to the fact the data is loaded prior to the page being displayed. But from everything I've read, this is all I need to do to reload the data.

I've also made sure that the "loadonce" option is set to false, but having no luck.

I'm assuming that I'll need to send off an AJAX request to the server to obtain new data, but I'm just enquiring if this is the best approach or is there a better way. Any code examples would be greatly appreciated.

Kind Regards,

Craig.

5 Answers
Abu Ghufran answered 7 years ago

Please refer demos/loading/load-session.php
It shows how to reload data from server for array based grid.

Craig Nicholls answered 7 years ago

Thanks for your quick response Abu, I'll have a look and let you know.

Cheers,

Craig.

Abu Ghufran answered 7 years ago

Hello,

Emailing you update.

Craig Nicholls answered 7 years ago

Hi Abu,

I purchased the full version earlier, but there is no download link for it that I can find? How do I download the latest version as the demos/loading/* directory only has 5 demos, none of which refer to sessions.

I've downloaded the free version, but the load-session.php is empty?

Please advise on new link.

Cheers,

Craig.

Craig Nicholls answered 7 years ago

Thanks mate.

Your Answer

6 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?