Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1071227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:41:06+00:00 2026-05-16T20:41:06+00:00

My problem is kinda silly but I don’t know how to do it. I’m

  • 0

My problem is kinda silly but I don’t know how to do it. I’m creating a standard flexigrid using standard structure:

//ver lib

    /*
     * 0 - display name
     * 1 - width
     * 2 - sortable
     * 3 - align
     * 4 - searchable (2 -> yes and default, 1 -> yes, 0 -> no.)
     */
    $colModel['users.id'] = array('id',40,TRUE,'center',1);
    $colModel['users.first_name'] = array('first_name',80,TRUE,'center',0);
    $colModel['users.last_name'] = array('last_name',180,TRUE,'left',1);
    $colModel['users.email'] = array('email',120,TRUE,'left',0);
    $colModel['users.username'] = array('username',130, TRUE,'left',0);
    $colModel['users.activation_code'] = array('activation_code',80, FALSE, 'right',0);
    $colModel['users.activated'] = array('activated',80, FALSE, 'right',0);
    $colModel['lists'] = array('Lists',90, FALSE, 'right',0);

    /*
     * Aditional Parameters
     */
    $gridParams = array(
    'width' => 'auto',
    'height' => 400,
    'rp' => 15,
    'rpOptions' => '[10,15,20,25,40]',
    'pagestat' => 'Displaying: {from} to {to} of {total} items.',
    'blockOpacity' => 0.5,
    'title' => 'Hello',
    'showTableToggleBtn' => true
    );

    /*
     * 0 - display name
     * 1 - bclass
     * 2 - onpress
     */
    $buttons[] = array('Delete','delete','test');
    $buttons[] = array('separator');
    $buttons[] = array('Select All','add','test');
    $buttons[] = array('DeSelect All','delete','test');
    $buttons[] = array('separator');


    //Build js
    //View helpers/flexigrid_helper.php for more information about the params on this function
    $grid_js = build_grid_js('flex1',site_url("admin/users/list_users"),$colModel,'users.first_name','asc',$gridParams,$buttons);

    $data['js_grid'] = $grid_js;

    $this->load->view('admin_panel/admin_content', $data);

Now my question is: is it possible to create a flexigrid WITH a parameter in third URI segment? For instance, I want to display a list, which user created and to do that I need his id. I can easily do that within the same controller but I want to pass it to different controller and create new flexigrid form there. So in ‘index()’ method can I have, for instance $get_id variable passed from different controller? Like this?

        $grid_js = build_grid_js('flex1',site_url("admin/admin_lists/display_show_list/".$get_id),$colModel,'name','asc',$gridParams,$buttons);

I hope I explained my problem well enough. Can someone give me some help with this? Mostly appreciated for any hints!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:41:08+00:00Added an answer on May 16, 2026 at 8:41 pm

    There are 2 ways you can achieve this:

    1. Create Helper
      Instead of using a controller to build your grid structure, you should create a helper to do it instead. Refer to http://codeigniter.com/user_guide/general/helpers.html

    Simply wrap the function in a helper will do.

    1. Use Ajax

    Create a function in controller like such:

    //in controller

    function makeGrid() { 
      $id = $this->uri->segment(3);
      $grid_js = .....;
    
      echo json_encode($grid_js);
    }
    

    //in View (Javascript)

    $.ajax({ 
       url:"/path/makeGrid" + id
       ...
       success: function(data){
          $.flexigrid( {... data .... });
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I'm kinda stuck on really silly problem, but still can't figure out. I'm
I'm kinda new to javascript running on Apache but I have the following problem.
I'm kinda new to jQuery, so this may be a silly question... My problem
Did ask a question about the same problem here: Silly problem with UTF8 but
I'm stuck with this kinda stupid problem. I saw examples of my problem, but
Hey, i have kinda silly problem, i need to set Point Pos as mouse
Yeah, kinda dumb title, but I found it hard to describe my problem. I
I know this may sounds silly but I would like to create function that
I have this kinda little problem using tinymce: When I'm using the insert image/photo,
my heading kinda explains the problem. I need to loop through multiple ul tags

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.