jquery is not working on phpgrid why??

Questionsjquery is not working on phpgrid why??
iqra asked 7 years ago

i complete read the documentation and install adminlte with laravel integration but one error is phpgrid is not calls jquery what happend with it i dnt knw please rply me fast.

4 Answers
Abu Ghufran answered 7 years ago

Thats because adminlte includes jquery again at footer of page, which reset all jquery + jqgrid settings.
You can remove second jquery include and it should work.

iqra answered 7 years ago

please tell me on which page i have to remove jquery.

Abu Ghufran answered 7 years ago

This level of support is out of the scope of PHPGrid.
You can hire some local developer for it.

Jawad answered 7 years ago

@iqra. I've found the solution for laravel, admin-lte, and phpgrid integration.

@Abu Ghufran. Please can you update your Laravel Integration guide as per my findings? (This includes admin-lte integration, plus issue with dependent dropdown)

SOLUTION (ADMIN-LTE Integration):
In Controller index method

public function index() {
include(app_path().'Libraryphpgridjqgrid.php');//update accoring to your path
$g = new jqgrid($DbConfig);
$g->table = "accounts";
$out = $g->render("grdmain");

$grid_script = substr($out, strpos($out, "<script>"));
$grid = substr($out, 0, strpos($out, "<script>"));

return view('accounts.index', compact('grid', 'grid_script'));
}

and index.php page looks as follows: (Don't include jquery.js as it is already included)

@extends('adminlte::page')

@Section('css')
<link rel="stylesheet" href="{{ asset('vendor/phpgrid/themes/ui-lightness/jquery-ui.custom.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/phpgrid/jqgrid/css/ui.jqgrid.bs.css') }}">

@Stop

@Section('js')
<script src="{{ asset('vendor/phpgrid/jqgrid/js/i18n/grid.locale-en.js') }}"></script>
<script src="{{ asset('vendor/phpgrid/jqgrid/js/jquery.jqGrid.min.js') }}"></script>
<script src="{{ asset('vendor/phpgrid/themes/jquery-ui.custom.min.js') }}"></script>

{!! $grid_script !!}
@Stop

@section('content')
{!! $grid !!}
@endsection

SOLUTION (Dependent Dropdown):
When using Laravel resource routes, the POST method is mapped to controller's store method. The dependent dropdown also uses the POST method that cause a conflict. You can update the routes in web.php as follows:

Web.php:

Route::resource('accounts', 'AccountsController', ['except' => ['store']]);
Route::post('accounts', (isset($_POST['target'])?'AccountsController@index':'AccountsController@store'))->name('accounts.store');

This is the work-around I've found. May be someone come with better solution.

Your Answer

6 + 11 =

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?