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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:48:45+00:00 2026-05-25T21:48:45+00:00

i have a function that return 7 values, i used a tuple to return

  • 0

i have a function that return 7 values, i used a tuple to return them since they dont have the same type
then i serelizes it
so i can read my resulted json in my js script , and i can access it via ItemN

take a look at the code:

 public JArray getJsonData( )
    {             

        //my queries here//  

        var vl = new List<Tuple<string, string,  string, int, int, double, string >>();

        vl.Add(new Tuple<string, string,  string,int, int, double, string>
             (item.Date , item.Adress,  name, item.login, pwd, role, id));                
        }

        JArray o = JArray.FromObject(vl);

        return o;          
    }

my extjs4 store:

var myStore2 = new Ext.data.JsonStore({

fields: ['Item1', 'Item2', 'Item3', 'Item4', 'Item5', 'Item6', 'Item7'] ,

data: []
});

the problem is that now i need to return another element which make them 8 elements in my tuple
so i get this funny error

the eight element of an eight tuple must be a tuple

so i add my eight element as a tuple as requested.

the problem is that now i get this json format: (notice ‘Rest’ at the end)

{Item1:"27-09-2011",Item2:"LA",Item3:"armance",Item4:"astrocybernaute",Item5:"P@ssw0rd",Item6:"Admin",Item7,Rest : {Item1 : 26 }}

the problem is that i dont know how to access it in my extjs4 store. Item8 of course doesnt work,Rest doesnt work,item1 doesnt either!!

any idea plz?

thank you for ur time

EDIT this is my new store after Matt Greer suggestion

Ext.define('MyModel', {
extends: 'Ext.data.Model',
fields: [
        { name: 'Item1' },
        { name: 'Item2' },
        { name: 'Item3' },
        { name: 'Item4' },
        { name: 'Item5' },
        { name: 'Item6' },
        { name: 'Item7' },
        { name: 'Item8', mapping: 'Rest.Item1' }
]
 });

 var myStore2 = new Ext.data.JsonStore({
 model: 'MyModel',
 proxy: {
     type: 'ajax',
     url: '',
     autoLoad :true,
     reader: {
         type: 'json'
             } 
        }
 });

but it still not working

SOLUTION
I want to point out that Store.loadData does not respect the field mapping

The issue is that the sencha team changed loadData’s behavior, AND it’s not something that’s documented in a way that is clear.

Add the following to your code base (above your app code, but below ext-all.js):

Ext.override(Ext.data.Store, {
loadDataViaReader : function(data, append) {
    var me      = this,
        result  = me.proxy.reader.read(data),
        records = result.records;

    me.loadRecords(records, { addRecords: append });
    me.fireEvent('load', me, result.records, true);
}            
});

then use:

mystore2.loadDataViaReader(data)
  • 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-25T21:48:46+00:00Added an answer on May 25, 2026 at 9:48 pm

    I’m not sure where that Tuple error is coming from. octuples are supported by .NET as shown here

    Give this a try

    var myTuple = Tuple.Create(3,4,5,8,12,4,12,99);
    

    myTuple should be a octuple of 8 ints.

    But, if you still get that error and you must work around it in Ext, you can use mappings. You need to define a Model, and in the Model’s fields use a mapping to grab that last value:

    Ext.define('MyModel', {
        extends: 'Ext.data.Model',
        fields: [
                { name: 'field1' },
                // fields 2 through 7
                { name: 'field8', mapping: 'Rest.Item1' }
        ]
     });
    
     var myStore = new Ext.data.JsonStore({
        model: 'MyModel',
        // ...
      });
    

    I’ve never actually tried defining fields right on the store, I assume Ext is creating a Model automatically for you. So you could probably do the mapping right in the store as well.

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

Sidebar

Related Questions

I have a function that uses out parameters to return multiple values to the
Say I have a Python function that returns multiple values in a tuple: def
If I have a function that returns an object, but this return value is
I have read documentation for functions such as values and define-values that return and
I want to have a function that will return the reverse of a list
Now I have a function that has to return a string. I saw a
I have 1 function that I want to return the address of an assigned
in delphi7 i have a function that i need to return a array as
I have this function here that assembles an API call to eBay. It used
I have the following function that I know should return TRUE but it will

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.