• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[SOLVED] Touch itemTpl ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] Touch itemTpl ?

    I'm working on my first MVC Touch app. I've gotten everything to work except the dataview list below. The panel displays with only one line and you can see the dash that's in the itemTpl between the two fields. The proxy loaded the store just fine and I see the root with the data. I must be missing something but I can't find it. It's a pretty simple list.

    Code:
    Ext.define('Loggers.view.Loggerpage', {
        extend: 'Ext.dataview.List',
    	xtype: 'loggerpage',
    	config: {
    		title: 'Loggers',
    		iconCls: 'star',
    		store: 'Loggerstore',
    		itemTpl: '{LOGRNAME}-{LOADCNT}'
    	}
    });

  • #2
    What does your loggerpage reside in? Viewport / another container..... When you state your seeing one line are you seeing your data?

    FYI iconCls is not a valid config for list.

    Comment


    • #3
      I'm confused why iconCls works, but it does. I based this test off of the senchadocs video MVC in depth part 1. I watched Ed Spencer type it right in just like I have it. The loggerpage is in a Viewport. I am not seeing the data, but i see the '-' that i put in the itemTpl between the fields.. there is also a space before it, so it seems to want to put something there, but no joy...

      Code:
      Ext.define('Loggers.view.Viewport', {
          extend: 'Ext.TabPanel',
      
      	config: {
      		fullscreen: true,
      		tabBarPosition: 'bottom',
      		items: [{
      			xtype: 'homepanel'
      		}, {
      			xtype: 'loggerpage'
      		}, {
      			xtype: 'contactpage'
      		}]
      	}
      });
      //app.js
      Code:
      Ext.Loader.setConfig({
          enabled: true
      });
      
      Ext.application({
      	name: 'Loggers',
      	appFolder: '/html/examples/touch/Rex/Loggers/app',
          models: ['Logger'],
      	stores: ['Loggerstore'],
      	controllers: ['Main'],
      	views: ['Home','Loggerpage','Contact'],
          launch: function(){
              Ext.create('Loggers.view.Viewport');
          }
      });

      Comment


      • #4
        Didn't know you were injecting your list into a tabpanel. So yes iconCls would be valid since its sitting in a tabpanel; Not sure why your not seeing your data. All I can think of is make sure your fields match in your itemTpl match your model;

        Comment


        • #5
          I've checked several times and even changed the names just in case. here's the model & store
          Code:
          Ext.define('Loggers.model.Logger', {
              extend: 'Ext.data.Model',
          	config: {
          		fields: ['LOGRNAME','LOGGER','LOADCNT'],
          		proxy: {
          			type: 'ajax',
          			url: 'vvcall.pgm',
          			extraParams: {
          				pgm: 'logrloads',
          				action: 'getLoggers'
          			},
          			reader: {
          				type: 'json',
          				root: 'loggers'
          			}
          		}
          	}
          });
          Code:
          Ext.define('Loggers.store.Loggerstore', {
              extend: 'Ext.data.Store',
          	config: {
          		model: 'Loggers.model.Logger',
          		autoLoad: true
          	}
          });
          Last edited by mwmayer4; 07-03-2013, 03:02 PM.

          Comment


          • #6
            when autoLoad is specified on the store, should I expect the same type results as I would in ExtJS or in Touch do I need to do something to push the records into the itemTpl?

            In an attempt to figure out why I'm not seeing any data, I took out the mode and the store and hard coded the store with some data in the Viewport (as they did in the tutorial video). That worked.

            So even though in my first try I saw a JSON response from vvcall in my proxy in the model, possibly my store isn't binding to the view for some reason???

            Comment


            • #7
              mystery solved.... ugh....

              proxy: {
              type: 'ajax',
              url: 'vvcall.pgm',
              extraParams: {
              pgm: 'logrloads',
              action: 'getLoggers'
              },
              reader: {
              type: 'json',
              root: 'loggers' //<---- should be rootProperty
              }
              }

              Comment

              Working...
              X