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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:36:07+00:00 2026-06-18T08:36:07+00:00

I am working in extjs4 MVC. Where i am getting stuck at a point*

  • 0

I am working in extjs4 MVC. Where i am getting stuck at a point*.Which is how to define object array in extjs4 and set values to it as well as retrieve values from that object.*I am tried but not yet solved.
Suppose I have Qusetion paper.Which displays some question with there options.I have got qustion with proper selected option.But I am not succeed to store it in proper models instance.I know how to store single record to particular model instance.But I dont know how to store repetative values to a particular model object.How I solve this probelm.

1) here is my some contrller file code

temp:function()
    {
        var obj = Ext.create('Demo.model.Poll');
        for(var i=0;i<4;i++)
        {
                var inputs = document.getElementsByName(i); 
                var radio = "";  
                for (var j = 0; j < inputs.length; j++) {
                    if (inputs[j].checked) {
                        name = inputs[j].name;
                        value  = inputs[j].value;
                        //console.log("questionId="+name +" value="+ value);
                        check.set('poll',name);
                        check.set('option',value);
                    }// End of if statment
                }// End of inner for loop
          }//End of outer for loop

        //Here I am going to display values inside object  
        console.log("----------------------------------");
          for(var i=0;i<4;i++)
          {
              console.log(i);
              console.log(check.get('poll'));
              console.log(check.get('option'));
          }
    //Is it possible to save object array to server side in single save method
    //  obj.save();

}// End of temp function

2) And after running this code i got last set value to model.In firebug i got this result.
for exampl.

3 
England 

3 
England 

3 
England


3 
England 

please give me some suggestion

  • 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-18T08:36:08+00:00Added an answer on June 18, 2026 at 8:36 am

    I have found the solution to my question and here is the answer.

    //code for getting question name and value from view and send to server side in a asingle request
    check:function()
    {
        //creating objects in javascript
            var storeObject=this.getStore('qb.QbquestionoptionStore');
        for(var i=0;i<=4;i++)
        {
                var inputs = document.getElementsByName(i); 
                var radio = "";  
                for (var j = 0; j < inputs.length; j++) {
                    if (inputs[j].checked) {
                        name = inputs[j].name;
                        value  = inputs[j].value;
                        console.log("questionId="+name +" value="+ value);
                            var check = Ext.create('Balaee.model.qb.QbquestionoptionModel');
                            check.set('questionId',name);
                            check.set('option',value);
    
                        storeObject.add(check);
                      //console.log("User Infooooooooo: option="+check.get('option')+"questionId="+check.get('questionId'));
                    }// End of if statment
                }// End of inner for loop
          }//End of outer for loop
        // code to display data in store object 
          for(var i=0;i<4;i++)
          {
              var record=storeObject.getAt(i);
              console.log("record no="+i);
              console.log("Qusetion Id="+record.get('questionId'));
              console.log("Option="+record.get('option'));
              console.log();
          }
          storeObject.sync();
    }// End of check function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am working in extjs4 MVC and I have been getting stuck at a
i am working in extjs4 MVC plus yii framework.I am getting stuck at a
I am working on an Extjs portal example and downloaded the example from extjs4-mvc-portal
I am working with Extjs4.1 MVC. What I am trying to do is save
Im working on an application in extJS4 and i need to enter 2 values:
i am working in extjs4 MVC where I have been working on task to
I am working on extjs4, my case is: Extjs mvc is used to build
Working with an undisclosed API, I found a function that can set the number
I'm working with a long form/survey in extjs which calls a script which then
I am using a star rating plugin with ExtJS that is working well, but

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.