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 3273286
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:54:57+00:00 2026-05-17T18:54:57+00:00

I’ve manage to get jqGrid 3.8 working in my project( Zend Framework ) using

  • 0

I’ve manage to get jqGrid 3.8 working in my project(Zend Framework) using json.While basic fetching of data works i failed to see why i can’t see the buttons showed on the navigation panel. here is what i’ve done on client side:

<script type="text/javascript">

 $(function(){ 
 $("#roomgrid").jqGrid({ 
     url:'/admin/admin-room/view', 
     datatype: "json",
     autowidth: true, 
     colNames:['Room ID','Room Number','Room Type','Image', 'Price','Facilities'], 
     colModel:[ {name:'id',index:'id', width:55,editable:false,hidden:true,editoptions:{readonly:true,size:10}}, 
                {name:'room_number',index:'room_number', width:55,editable:false,editoptions:{readonly:true,size:10}}, 
                {name:'name',index:'name', width:80,editable:true,editoptions:{size:10}},  
                {name:'pic_url',index:'pic_url', width:90,editable:true,editoptions:{size:25}}, 
                {name:'price',index:'price', width:60, align:"right",editable:true,editoptions:{size:10}}, 
                {name:'facilities',index:'facilities', width:60, editable:true,editoptions:{size:10}}], 
    rowNum:5, 
    rowList:[5,8,10,20,30], 
    pager: '#paged',
    sortname: 'id',
    sortorder: "desc",
    viewrecords: true,
    caption: 'Manage Rooms'});
 });
$("#roomgrid").jqGrid('navGrid','#paged', {view: true,del:true}); 

</script>

<table id="roomgrid"></table>
<div id="paged"></div>

on the server side i have this:

public function preDispatch(){
    $this->_helper->viewRenderer->setNoRender();
    $this->_helper->layout()->disableLayout();
}
public function viewAction() {

    $filters = array(
    'page'=>array('HtmlEntities','StringTrim'),
    'rows'=>array('HtmlEntities','StringTrim'),
    'sidx'=>array('HtmlEntities','StringTrim'),
    'sord'=>array('HtmlEntities','StringTrim'));

    $validators = array(
    'page'=>array('NotEmpty','Int'),
    'rows'=>array('NotEmpty','Int'),
    'sord'=>array('NotEmpty'));

    $input = new Zend_Filter_Input($filters,$validators);
    $input->setData($this->getRequest()->getParams());
    if($this->getRequest()){
        if($input->isValid()){

            $this->response->page = $input->page;

            $input->rows);
            echo $this->getRooms('jqgrid', $input->page, $input->rows);
        }
    }



}


public function getRooms($switch, $page, $rows){
    $q = Doctrine_Query::create()->select("r.id,r.room_number,t.name,r.pic_url, r.price, r.facilities")
    ->from("Hotel_Model_Room r")
    ->leftJoin("r.RoomType t");

    $pager = new Doctrine_Pager($q,$page, $rows);
    $result = $pager->execute(array(), Doctrine_Core::HYDRATE_ARRAY);
    $totalpages = $pager->getLastPage();
    $totalrecord = Doctrine_Core::getTable("Hotel_Model_Room")->count();

    switch ($switch){
        case 'array':
            return $result;
            break;
        case 'jqgrid' :
            return $this->formatJqgridRoom($result, $page,$totalpages, $totalrecord);
            break;
    }
}

public function formatJqgridRoom($resultset, $page='1', $totalpages, $count){

    $rows= array();

    $response->page = $page;
    $response->total = $totalpages;
    $response->records = $count;

    foreach ($resultset as $key => $value){
        $response->rows[$key]['id'] = $value['id'] ;
        $response->rows[$key]['cell'] = array($value['id'],     $value['room_number'],$value['RoomType']['name'], $value['pic_url'], $value['price'],$value['facilities']) ;
    }


        return json_encode($response);

}

I’m using jquery ui redmond theme, i made sure jqGrid is using it, when css include is commented out ,the grid is not blue anymore.I’ve also tried to reference the css itself using imagepath option and it didn’t make any difference. there is the css folder structure

\css
  \redmond
    \images
    jquery-ui-1.8.5.custom.css
 ui.jqgrid.css
 layout.css

Another problem is that i can’t find where row fonts css are picked from.they are a little too big here.I believe i downloaded it straight from jqueryui site so i’m little confuse now.There is obviously something i’m doing wrong and up to now i can’t find it.So i’m a little confused about that.

thanks for reading this.

  • 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-17T18:54:58+00:00Added an answer on May 17, 2026 at 6:54 pm

    Fixed it.i forgot i had to put the pager definition

    $("#roomgrid").jqGrid('navGrid','#paged', {view: true,del:true}); 
    

    into the query

    $(function(){})
    

    as you can the navGrid function was defined ouside it. reason why it wasn’t showing.thanks.
    i hope this helped someone

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I want to construct a data frame in an Rcpp function, but when I
I have thousands of HTML files to process using Groovy/Java and I need to

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.