PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun May 31, 2020 2:38 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Dec 03, 2015 10:57 am 
Offline
Forum Contributor

Joined: Thu Apr 16, 2015 7:55 am
Posts: 110
Hi There,
I'm new to web development. I've an existing application, to which no active developer is there. Legacy code is wrapped in a laravel framework.
Laravel version 4.2
php version 5.5
OSX 10.9

I want data to be loaded in my jqgrid. I call from javascript. Get method. I can reach to route from it, however after that, I don't see myself moving ahead. No error, nothing.

My js code looks like:

Syntax: [ Download ] [ Hide ]
$(document).ready(function () {
       
        $("#grid_illumina").jqGrid({
               
                url:'illumina_xhr_get_data',
                datatype: "json",
                mtype: "GET",
                jsonReader: {
                    repeatitems: false,
                    id: "",
                    root:  function (obj) {
                        return obj;
                    },
                    records: function (obj) {
                        return obj.length;
                    },
                    page: function () {
                        return 1;
                    },
                    total: function () {
                        return 1;
                    }
                },
               
                colNames:['study','Sample Name','Forward Primer','Reverse Primer'],
        colModel :[
                   {name:"study",sortable: true},
                   {name: "sample_name",sortable: true},
                   {name: "forward_primer",sortable: true},
                   {name: "reverse_primer",sortable: true}
                   ],
                rowNum:10, //this sets the default row in the pager
               
            caption:"jqGrid Illumina", //title of the grid
                        pager: '#pager_illumina',      
                        shrinkToFit : false,
                rownumbers: true, //row numbers on left
                multiselect: true, //check box
                        height: '400', //height: 'auto',
                        width: '1100',
                        gridview: true,                
                        viewrecords:true, // this is for the View 1 - 8 of 8 \m/
                        sortorder:"asc", //asc
                        autoencode: true, //don't know
                        sortable:true, //sort
                        loadonce: false, //loadonce is must
                        rowList:[3,6,9], //drop down
                        page: 1,
                        rowNum: 3
        });
 

URI - illumina_xhr_get_data

My routes:
Syntax: [ Download ] [ Hide ]
Route::group(['prefix' => 'illumina', 'namespace' => 'Controllers\\illumina'], function() {
       
        Log::info(Request::path()); //$uri = Request::path();
       
        Route::get('illumina_xhr_get_data','mainIllumina@testAjax');
               
});
 


My mainIllumina looks like:
Syntax: [ Download ] [ Hide ]

<?php namespace Controllers\illumina;
use Log;

class mainIllumina extends \BaseController {

        public function testAjax(){
               echo "haha"; //cannot reach
                Log::info("In the function of ajax");
        }
}
?>
 


I do not reach this function.
If I do it from the browser too, cannot reach function.
Any help or guidance shall be highly appreciated.


Top
 Profile  
 
PostPosted: Thu Dec 03, 2015 11:18 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
You've got illumina as a prefix to the route group, but your URL doesn't start with illumina/

_________________


Top
 Profile  
 
PostPosted: Thu Dec 03, 2015 11:23 am 
Offline
Forum Contributor

Joined: Thu Apr 16, 2015 7:55 am
Posts: 110


Top
 Profile  
 
PostPosted: Thu Dec 03, 2015 11:27 am 
Offline
Forum Contributor

Joined: Thu Apr 16, 2015 7:55 am
Posts: 110
Update:
After your comment, I changed URL to
Syntax: [ Download ] [ Hide ]
                url:'illumina/illumina_xhr_get_data',
 

And I can reach my ajax function in the Illumina.

But that leaves me wondering Why I was entering below function at first?

Syntax: [ Download ] [ Hide ]
Route::group(['prefix' => 'illumina', 'namespace' => 'TGen\\Controllers\\illumina','before' => 'auth'], function() {
       
        Log::info(Request::path()); //$uri = Request::path();

 


Thank you again for your prompt reply Cel :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group