Results 1 to 2 of 2

Thread: Getting Record Sub-Data

  1. #1
    Sencha User
    Join Date
    Apr 2007
    Posts
    138
    Answers
    1

    Default Getting Record Sub-Data

    I have a dataview that displays records from a nested store. When I tap on the dataview item, I can access the top level data from the store, but I can't seem to get the nested sub-level data.

    My store data is structured as follows:

    Code:
    courses
       |
       |_ tests
              |
              |_ questions
                      |
                      |_ answers
                      |
                      |_ response
    The following Fiddle (below) should help illustrate my problem.

    1. Once the Fiddle is loaded, tap on the 'Archives' tab at the bottom of the screen.
    2. Tap on one of the data items. The top level data (courses) is loading, but I also need to access the sub-level data (tests), and even the next level (questions), and so on.


    You can see in the 'mainPanel' controller (onArchivesTabDataviewItemTap) where I have attempted to get the data using the index of the record, but since the top level record is a singular item, it always comes back as 0. I'm thinking that if I can get the index of the tapped item, I can sort down to the sub level using the following code:

    Code:
    var tests = record.tests();
    console.log(record.data.tests[index].testName);
    I haven't had any luck getting the tapped item's index, however. Also I may be completely off base with my assumption, so any help accessing the sub-level data would be appreciated.


  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi Cybjorg--

    The Fiddle doesn't seem to be working as described--can you update it? I'll be happy to test it along with you.

    Thanks!
    Joel

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •