Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: XML associations from 4.1 to 5.1.1 upgrade not working.

  1. #1
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    115
    Answers
    13

    Default Answered: XML associations from 4.1 to 5.1.1 upgrade not working.

    I'm slowly upgrading our apps from 4.1 to 5.1.1 and I'm pulling my hair out with XML associations that work fine in 4 but not in 5

    Snippet of XML
    Code:
    <eventtab label="Event Reports">    <treetabs width="265" defaulttab="1" search="Enter search term">
          <usertab>Users</usertab>
          <grouptab>Groups</grouptab>
          <sitetab>Sites</sitetab>
          <volumetab expand-while-loading-report="1">Volumes
            <skip-volumes>1
              <volume includeinform="1"><![CDATA[/Volumes/newbasketstore]]></volume>
    <volume includeinform="1"><![CDATA[/Volumes/datastore]]></volume>
            </skip-volumes>
            <expand>Expand</expand>
            <show-volumes>Volume Info</show-volumes>
          </volumetab>
        </treetabs>
    </eventtab>
    Master XML Model in 4
    snippet
    Code:
    Ext.define('analytics.model.XMLAnalyticsConfiguration', {
    	extend: 'Ext.data.Model',
    	fields: [
                     .....
            ],
    	associations: [
            {
    				type: 'hasMany',
    				model: 'analytics.model.XmlSkippedVolumes', 
    				name: 'skippedvolumes',
    				associationKey: '/eventtab/treetabs/volumetab/skip-volumes'
    	},
            proxy: {
    		type: 'ajax',
    		reader: {
    			type: 'xml',
    			record: 'portal-analytics-page-description'
    		}
        }
    });
    Associations Model 4
    Code:
    Ext.define('analytics.model.XmlSkippedVolumes', {	extend: 'Ext.data.Model',
    	autoLoad: true,
    	fields: [
    	  {name: 'includeinform', mapping: '/@includeinform', type: 'boolean', defaultValue: false},
    	  {name: 'path', mapping: '/', type: 'string',defaultValue: ''}
    	],
    	belongsTo: 'analytics.model.XMLAnalyticsConfiguration',
    	proxy: {
    		type: 'memory',
    		autoLoad: true,
    		reader: {
    			type: 'xml',
    			root: 'volume',
    			record: '/'
    		}
    	}
    });
    All above is working in ExtJs 4

    Master XML Model in 5.1.1
    snippet
    Code:
    Ext.define('analytics.model.XMLAnalyticsConfiguration', {
    extend: 'Ext.data.Model',
    requires:['analytics.model.XmlSkippedVolumes'],
    fields: [
           ......
    ],
    associations: [
             {
                type: 'hasMany',
                model: 'analytics.model.XmlSkippedVolumes', 
                name: 'skippedvolumes',
                associationKey: '/eventtab/treetabs/volumetab/skipvolumes'
    },
    proxy: {
         type: 'ajax',
                 reader: {
                          type: 'xml',
                          record: 'portal-analytics-page-description'
               }
          }
    });
    Associations Model 5

    Code:
    Ext.define('analytics.model.XmlSkippedVolumes', {	extend: 'Ext.data.Model',
    	autoLoad: true,
    	fields: [
    	  {name: 'includeinform', mapping: '/@includeinform', type: 'boolean', defaultValue: false},
    	  {name: 'path', mapping: '/', type: 'string',defaultValue: ''}
    	],
    	proxy: {
    		type: 'memory',
    		autoLoad: true,
    		reader: {
    			type: 'xml',
    			record: '/',
    			rootProperty: 'volume'
    		}
    	}
    });
    Thanks

  2. Seems to have been a bug in 5.1.0, downloaded and upgraded my app to 5.1.1 and it fixed the issue

  3. #2
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    Can you share a test case that demonstrates the issue you're experiencing? I tried to create a Fiddle from the code you shared, but there appear to be some missing pieces.

    https://fiddle.sencha.com

    Thanks!
    Joel

  4. #3
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    115
    Answers
    13

    Default

    Not easy to do as the XML loads from a server and this is a very large analytical dashboard app, it runs fine in ExtJs4 juts kicking my a** trying to get it up and running with ExtJs 5.Can not figure out the difference in the XML reader between 4 and 5thanks

  5. #4
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi-

    Fiddle can simulate AJAX requests, and XML is a supported response type. To add mock data, you can click the "+" icon at the bottom of the main view and add the data and name the file whatever you'd like. You can then use this file as the "url" for your proxy.

    Thanks
    Joel

  6. #5
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    115
    Answers
    13

    Default

    I have spent some time trying to get this into Fiddle, I'm not a fiddle expert.This is a very large dashboard analytical dashboard app, fully working in 4. I have taken the relevant parts int fiddle but getting syntax errors on lines that don't even exists.I've now spent over 20 hours trying to get XML associations working in 5. I'm at a loss, can I use a ticket and so a screen share. I could send the code but it needs to run a third party server you would not have access to.I'm really in a hole here, it has to be something really simple I'm missing. I could show you in a 5 minute screen share.thanks

  7. #6
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    Regarding the test case, can you not just share the model definitions and a full snippet of the relevant data? That should be all that is necessary to create a test case that demonstrates the issue.

    Thanks!
    Joel

  8. #7
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    115
    Answers
    13

    Default

    Thats what I did in the Fiddle, is that working for you?

  9. #8
    Sencha User
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Quote Originally Posted by harrypottar View Post
    Thats what I did in the Fiddle, is that working for you?
    Can you re-share the link to the Fiddle? I don't see it in your previous response.
    Thanks
    Joel

  10. #9
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    115
    Answers
    13

  11. #10
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    115
    Answers
    13

    Default

    Do you have any thoughts on this, really stuck, should work but can not figure out why it does not

Page 1 of 2 12 LastLast

Similar Threads

  1. How to get model associations working?
    By RoyalSens in forum Ext: Q&A
    Replies: 2
    Last Post: 29 Oct 2013, 3:52 AM
  2. hasOne associations - need a working example
    By Whatty in forum Sencha Ext JS Q&A
    Replies: 2
    Last Post: 19 Sep 2012, 11:17 AM
  3. Self Associations - Not Working
    By HI50als in forum Ext: Q&A
    Replies: 1
    Last Post: 3 Feb 2012, 6:32 AM
  4. [CLOSED] Associations not working
    By wiznia in forum Ext:Bugs
    Replies: 5
    Last Post: 18 Aug 2011, 8:16 AM

Posting Permissions

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