Can I integrate phpgrid with Laravel framework. If Yes, can you send some basic example.
The example would be little difficult now, but here is how it works.
PHP Grid works independently from the framework lib and don't use data access layers of framework.
To integrate in MVC, You can divide code in 2 sections. And put first in controller and pass the $out variable to view, where you can render it with rest of JS/CSS files.
$g = new jqgrid();
$out = $g->render("list1");
<link rel="stylesheet" type="text/css" media="screen" href="js/themes/redmond/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="js/jqgrid/css/ui.jqgrid.css"></link>
<?php echo $out?>
I tried this but getting error "Couldn't execute query. No database selected ". How do I set the connection to use from the framework.
I managed to get the DB part working, but when I try to update any data,the framework throws HttpNotAllowed exception. It is because of the routes mechanism defined in the framework. Any way to fix this?
I'm also having this problem. The table is loading fine but I can't edit because of the HttpNotAllowed exception.
Ok, so I solved it by adding a POST route to the page. The MethodNotAllowed exception happens because phpgrid is trying to post to a GET only page. So I made a POST route for my page and it is fine!
There still so much to do for the grid to work with Laravel. Laravel needs to pass in a token with every POST. So how do we intercept the POST to add the data, value pair _token = 'xxxxxx' to the post data?
Nevermind. I found my answer here:
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?