ajaxEditOptions

QuestionsajaxEditOptions
Nielsen asked 6 years ago

We have CSRF restriction and how can I add the Ajax header with CSRF token in order to perform the inline edit action? Thanks.

1 Answers
Abu Ghufran answered 6 years ago

You can set following for token:value — X-CSRF-Token', 'abc'

$grid["loadBeforeSend"] = "function(jqXHR) { jqXHR.setRequestHeader('X-CSRF-Token', 'abc' );}";
$grid["edit_options"]["ajaxEditOptions"]["beforeSend"] = "function(jqXHR) { jqXHR.setRequestHeader('X-CSRF-Token', 'abc' );}";
$grid["edit_options"]["ajaxEditOptions"]["beforeSend"] = "function(jqXHR) { jqXHR.setRequestHeader('X-CSRF-Token', 'abc' );}";

$g->set_options($grid);

If you can manage COOKIE based csrf, it would make things more simpler.

Your Answer

3 + 2 =

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?