Welcome Guest, Not a member yet? Register   Sign In
flexigrid and CI 2.0.3 token
#2

[eluser]Unknown[/eluser]
OK Here is the solution:
in flexigrid_helper.php put:
$grid_js .= "<name of your token from config.php>: '".$CI->security->get_csrf_hash()."',";
At about line 50.
Then in flexigrid.js put:
onChangeSort: false,
onSuccess: false,
<name of your token from config.php> : '',
onError: false,
onSubmit: false //using a custom populate function
}, p);
At about line 45-50.
Then further down in flexigrid.js put:
{
name: 'query',
value: p.query
}, {
name: 'qtype',
value: p.qtype
}, {
name: '<name of your token from config.php> ',
value: p.<name of your token from config.php>
}];
if (p.params) {
for (var pi = 0; pi < p.params.length; pi++) {
param[param.length] = p.params[pi];
}
}
At about line 520-530
This will add the csrf token with the right parameter name to json request sent by flexigrid.


Messages In This Thread
flexigrid and CI 2.0.3 token - by El Forum - 11-02-2011, 12:05 PM
flexigrid and CI 2.0.3 token - by El Forum - 11-07-2013, 05:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB