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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:58:23+00:00 2026-05-18T02:58:23+00:00

I am using ExtJS with an XMLReader to display content in a GridPanel. This

  • 0

I am using ExtJS with an XMLReader to display content in a GridPanel. This works fine, however my XML source has an unpredictable number of repeated elements:

<beamline> 
  <technique>Tomography</technique> 
  <technique>Phase contrast imaging</technique> 
  <technique>Microdiffraction</technique> 
  <technique>General diffraction</technique> 
</beamline>

There could be anywhere from 0-30 <technique> elements.

Currently I’m pulling these out manually in the XMLReader using the :nth(n) option:

{name: 'technique1', mapping: 'technique:nth(1)'},
{name: 'technique2', mapping: 'technique:nth(2)'},

and then placing these in the panel as columns and concatenating with a renderer function:

{header: "Technique", width: 100, dataIndex: 'technique1', sortable: false, renderer: techniques},
{header: "Technique2", dataIndex: 'discipline2', hidden: true},

function techniques(val, x, store){
  return '<ul><li>'+val+'</li><li>'+store.data.technique2+'</li></ul>';
}

but this is obviously too clunky to scale. Is there a generic (loop or XPath-style) method to achieve a similar result?

  • 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-18T02:58:24+00:00Added an answer on May 18, 2026 at 2:58 am

    I’ve not used the XML reader but I had a similar problem where I had to display a row where a column could contain N items.

    Screenshot showing problem

    Assuming the techniques column contains an array of objects you could render it as

    function techniquesRenderer(val){
       var returnValue = '<ul>';
       for(var v in val){
         var foo = val[v];
         returnValue += '<li>' + foo.someProperty + '</li>';
       }
       return returnValue += '</ul>
    }
    

    Hope this helps.

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

Sidebar

Related Questions

I'm using extjs charts to display some data. In this data, the axis and
So I am adding StaticTextField controls to a page. This is using ExtJS, but
This is in ASP.NET. We are using a ExtJS frontend, and have our own
I am using extjs textfield in one of the grids in a webpage. This
I'm new in using Extjs Library , I want to use GridPanel but I
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active
Using ExtJs. I'm trying to design a main which is divided into three sub
// Using extjs 3.x var box = new Ext.Textfield { /* textField configuration */
I'm using ExtJS v2.0 . I would like to grab the gridfilter values and

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.