Export after loading data via AJAX

QuestionsExport after loading data via AJAX
Craig McCormack asked 7 years ago

Hi there,
I’ve successfully loaded data via AJAX (see code below) to the grid and all is working well on screen.

$(“#g_users_list”)
.jqGrid(‘clearGridData’)
.jqGrid(‘setGridParam’,
{
data: r.users_list
})
.trigger(“reloadGrid”);

After loading the data via this way, the Export functions only product blank files. If I load the data via the PHP file on the server, the export functions as expected.
I’ve dug around in the source of the rendered page and can see the difference is that on the AJAX load, the “data”: [] object is empty (as I would expect), however, it appears that phpGrid is using this rather than the dynamically loaded content?
Can you please provide any insight or explain what I’m doing incorrectly?
Cheers,
Craig.

2 Answers
Abu Ghufran Staff answered 7 years ago

Please try “url” option to exact php page from where you are loading grid via ajax.

$opt["url"] = "<url>/<file>.php";
...
$g->set_options($opt);

If still not solved, please share online link for review. You can email me details at [email protected]

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Craig McCormack answered 7 years ago

Thanks I\’ll give it a go.

Your Answer

17 + 13 =

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?