using Grid4php cell edit mode with laravel 5.x framework

Questionsusing Grid4php cell edit mode with laravel 5.x framework
Jim Poon asked 5 years ago

Hi, I am using the latest grid4php 2.6.3 full version with laravel framework.

In Cell Edit mode, whenever I changed the content of a cell and pressed the TAB key, the web frontend JS will call the browser URL with some URL variables.

Under the laravel controller+view, this will call some controller routine continuously which is unexpected.

In controller side, it do the rendering:

$ValuesGridOut = $g->render(“ValuesList”);

 

In view side, it do the HTML code:

<div style=”margin:5px;”>{!! $ValuesGridOut !!}</div>

 

In the nginx access log, it shows may form post or AJAX calls.
10.0.2.2 – – [02/Apr/2020:15:07:47 +0800] “GET /cbs/scoretable/7 HTTP/1.1″ 200 114417 “http://localhost:8000/cbs/project_manage/hkbsi&#8221; “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
10.0.2.2 – – [02/Apr/2020:15:07:54 +0800] “GET /favicon-32×32.png HTTP/1.1” 200 2545 “http://localhost:8000/cbs/scoretable/7″ “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
10.0.2.2 – – [02/Apr/2020:15:08:03 +0800] “GET /cbs/scoretable/7?grid_id=ValuesList&_search=false&nd=1585811268264&rows=10&jqgrid_page=1&sidx=1&sord=asc HTTP/1.1″ 200 828 “http://localhost:8000/cbs/scoretable/7″ “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
10.0.2.2 – – [02/Apr/2020:18:02:02 +0800] “GET /cbs/scoretable/7 HTTP/1.1″ 200 114426 “http://localhost:8000/cbs/project_manage/hkbsi&#8221; “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
10.0.2.2 – – [02/Apr/2020:18:02:03 +0800] “GET /css/admin_style.css?ver=4663164c87b79dd665498fcbb0cb59a2 HTTP/1.1” 200 124027 “http://localhost:8000/cbs/scoretable/7″ “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
10.0.2.2 – – [02/Apr/2020:18:02:16 +0800] “GET /cbs/scoretable/7?grid_id=ValuesList&_search=false&nd=1585821723557&rows=10&jqgrid_page=1&sidx=1&sord=asc HTTP/1.1″ 200 828 “http://localhost:8000/cbs/scoretable/7″ “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
 

My question is: anyway for me to check for this so that I can by pass some logic in the laravel controller code? I need this because there are some TEMP table creation codes in controller side. I did not expect the controller side will be called from time to time during cell edit.

 

screen:

https://imgur.com/a/WxJsmQA

2 Answers
Jim Poon answered 5 years ago

further findings:

I found that whenever i edit a CELL and pressed TAB, there will be a POST from web frontend JS. as shown below.

How can i check this from the laravel controller to prevent this?

web server nginx access log:
10.0.2.2 – – [02/Apr/2020:18:22:16 +0800] “POST /cbs/scoretable/7?grid_id=ValuesList HTTP/1.1″ 200 56 “http://localhost:8000/cbs/scoretable/7&#8221; “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
10.0.2.2 – – [02/Apr/2020:18:22:24 +0800] “POST /cbs/scoretable/7?grid_id=ValuesList HTTP/1.1″ 200 56 “http://localhost:8000/cbs/scoretable/7&#8221; “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
10.0.2.2 – – [02/Apr/2020:18:22:32 +0800] “POST /cbs/scoretable/7?grid_id=ValuesList HTTP/1.1″ 200 56 “http://localhost:8000/cbs/scoretable/7&#8221; “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
10.0.2.2 – – [02/Apr/2020:18:22:32 +0800] “POST /cbs/scoretable/7?grid_id=ValuesList HTTP/1.1″ 200 56 “http://localhost:8000/cbs/scoretable/7&#8221; “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36”
 

Abu answered 5 years ago

Hi,

In excel mode, whenever a cell is switched the updated value of cell in saved table.
It works this way and there is no combined update function.

If you don’t save it, you will lose the changes as it is not saved locally.

Just in case you want to identify grid ajax call,
$is_grid_call = isset($_REQUEST[“nd”]) || isset($_REQUEST[“oper”]) || isset($_REQUEST[“export”]);

Your Answer

20 + 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?