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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:40:53+00:00 2026-06-05T05:40:53+00:00

I have a Web Application that currently uses JQGrid but I’m trying to introduce

  • 0

I have a Web Application that currently uses JQGrid but I’m trying to introduce Backbone.js to improve code organization. What I’m trying to do is get data from the server using a Collection, and then add the JSON information to my defined JQGrid but I can’t get it to work. My JQGrid is defined like this:

var tareasHumanasTable = $("#grillaTH").jqGrid({
        datatype: 'local',
        height: 'auto',
        colNames:[ colNames...],
        colModel:[ colModel...]
}

And my Model and Collection are defined like this:

window.TareaHumana = Backbone.Model.extend();

window.TareaHumanaCollection = Backbone.Collection.extend({
    model:  TareaHumana,
    url: "bandejaTareas/buscarTH"
});

I have a button that when clicked starts server communication. Now is doing this:

$(function(){
    $("#botonBuscar").bind('click',function(){
        var tareaHumanaList = new TareaHumanaCollection();
        tareaHumanaList.fetch({data: $("#formBandejaTareas").serializeObject()});
        //alert("tareaHumanaList.toJSON(): " + tareaHumanaList.toJSON());
        tareaHumanaList.each(function(tareaHumana, i){
            //alert("tareaHumana.toJSON(): " + tareaHumana.toJSON());
            tareasHumanasTable.jqGrid('addRowData', (i + 1), tareaHumana.toJSON());
        });

That code doesn’t work at all. With Firebug I verified that the server sends the data in the correct format but the code isn’t working. The weirdest thing is that when I uncomment the “alert(…)” lines everything starts to work.

  • 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-06-05T05:40:54+00:00Added an answer on June 5, 2026 at 5:40 am

    The key is that fetch is asynchronous. So if you immediately call each after fetch it’s probably your collection won’t be populated. You should use success callback. For example take a look at this answer.

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

Sidebar

Related Questions

I have a web application that can load plugins through reflection. It currently uses
We have a web application that uses dropbox as file storage. We have currently
We have a web application that uses Spring (3.0.5) and CXF (currently 2.4.2 for
I have a web application that uses RESTful url patterns. Currently if a users
I have a web application that I am currently working on that uses a
I have a Flex/Java web application that uses Maven as a build tool. Currently,
I am currently working on a web application that uses PHP and MySQL, but
We have a desktop application written in Java Swing that currently uses Java Web
I have a Java web application that currently uses Log4J for logging. I'd like
I have a web application that currently uses Flash. That application allows the user

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.