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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:24:50+00:00 2026-06-11T19:24:50+00:00

is it possible to create such a grid as shown below?? I have two

  • 0

is it possible to create such a grid as shown below??
I have two models with hasmany association:

Ext.define('Question', {
extend: 'Ext.data.Model',
fields: [
    {name: 'questionId', type: 'int', convert: null},
    {name: 'content',     type: 'string'},
    {name: 'type',     type: 'int'},
],
hasMany  : {model: 'Answer', name: 'answers'},

idProperty: 'questionId'});

Ext.define('Answer', {
extend: 'Ext.data.Model',
fields: [
    {name: 'answerId', type: 'int', convert: null},
    {name: 'question_id', type: 'int'},//foreignKey
    {name: 'content',     type: 'string'},
    {name: 'isCorrect',     type: 'boolean'},
    {name: 'isMarked',     type: 'boolean'},
],
 associations: [
    { type: 'belongsTo', model: 'Question' }
],
idProperty: 'answerId'}); 

JSON Example

{"data":[
{"questionId":4100,"content":"12:4?","type":"2","answers":
  [{"answerId":1051,"content":"11","isCorrect":true,"isMarked":false},    
   {"answerId":1052,"content":"11","isCorrect":false,"isMarked":false},      
   {"answerId":1053,"content":"11","isCorrect":false,"isMarked":false}
]},
{"questionId":4101,"content":"12:4?","type":"2","answers":
  [{"answerId":1054,"content":"11","isCorrect":true,"isMarked":false},    
   {"answerId":1055,"content":"11","isCorrect":false,"isMarked":false},      
   {"answerId":1056,"content":"11","isCorrect":false,"isMarked":false}
]}],"success":true}   

Here is the link to show grid view
http://imageshack.us/photo/my-images/834/examgrid.jpg/

Questions can have different number of answers or if it isn’t possible the same number of answers.
Checkbox is used for marking isMarked fields.

Can anyone give me example?

Thanks

  • 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-11T19:24:51+00:00Added an answer on June 11, 2026 at 7:24 pm

    Out of the box, no. Using a view, yes. But I recommend you to nest the answers into question instead of using a separate model. You will have to write a XTemplate with a inner function that renders the answers.

    You will not have sortable columns with that approach. This would be a bit more work.

    So the last one interested me too, here’s a working snipped without any formating!!

    Ext.define('Image', {
        extend: 'Ext.data.Model',
        fields: [
            { name:'question', type:'string' },
            { name:'answer', type:'auto' }
        ]
    });
    
    
    Ext.create('Ext.data.Store', {
        id:'imagesStore',
        model: 'Image',
        data: [
            { question:'Drawing & Charts', answer: [{text: 'yes'}, {text: 'no'}] },
            { question:'Advanced Data', answer: [{text: 'yes'}, {text: 'no'}] },
            { question:'Overhauled Theme', answer: [{text: 'yes'}, {text: 'no'}] },
            { question:'Performance Tuned', answer: [{text: 'yes'}, {text: 'no'}] }
        ]
    });
    
    
    var imageTpl = new Ext.XTemplate(
        '<Table>',
        '<tpl for=".">',
            '<TR>',
                   '<TD>{#}</TD>',
                '<TD>{question}</TD>',
                '<TD>',
                    '<tpl for="answer">',
                        '{text}',
                    '</tpl>',
                '</TD>',
            '</TR>',
        '</tpl>',
        '</Table>'
    );
    
    
    Ext.create('Ext.view.View', {
        store: Ext.data.StoreManager.lookup('imagesStore'),
        tpl: imageTpl,
        itemSelector: 'div.thumb-wrap',
        emptyText: 'No images available',
        renderTo: Ext.getBody()
    });  
    

    and the JSFiddle

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

Sidebar

Related Questions

Is it possible to create HTML lists such as ordered and unordered lists without
Is it possible to create virtual files (such as /proc/uptime for exanple) in java?
Is it possible to create an object from a dictionary in python in such
Is it possible to create a regular expression that matches a comparison such as
Is it possible to create a driver (windows/mac) for a custom usb hub such
Is it possible and how to create objects of such classes like NSString from
MvcSiteMap - https://github.com/maartenba/MvcSiteMapProvider [originally at: http://mvcsitemap.codeplex.com/] Is it possible to create such links in
As it is MyClass x = 120; , is it possible to create such
Is is possible in SQL Server 2008 to create such a constraint that would
I have IEnumerable collection. I want to create such method: public IEnumerable<object> Try_Filter(IEnumerable<object> collection,

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.