Note that there are some explanatory texts on larger screens.

plurals
  1. POIncluding a Sencha Component inside an XTemplate
    primarykey
    data
    text
    <p>I'm developing a Sencha Touch application in which I'm doing lots of <code>Ext.extend</code> and creating my own custom components and classes. I'm relatively new to the Sencha Touch realm, and I'm having a bit of a problem trying to use one of my components inside an <code>Ext.XTemplate</code>. Here's a concept of what I'm trying to do in some code:</p> <pre><code>MyObj = Ext.extend(Ext.Panel, { cls: 'myClass', layout: 'card', scroll: 'vertical', monitorOrientation: true, config: myConfigObject.localObjectType, loc: 'en_US', initComponent: function() { // some random init code here… // Including: var tpl = new Ext.XTemplate( '&lt;tpl for="."&gt;', '&lt;tpl if="Available === true"&gt;&lt;div class="itemAvail"&gt;&lt;/tpl&gt;', '&lt;tpl if="Available !== true"&gt;&lt;div class="itemNotAvail"&gt;&lt;/tpl&gt;', '&lt;div class="formText"&gt;', // INSERT MY VIDEO COMPONENT HERE… '&lt;/div&gt;', '&lt;/div&gt;', '&lt;/tpl&gt;', { compiled : true } ); }, // Object definition continues, but I don't think it's germane to this discussion… }); Ext.reg('videoList', MyApp.views.VideoList); </code></pre> <p>And now the semi-code for my Video Component that I need included above:</p> <pre><code>MyVideoComponent = Ext.extend(Ext.Panel, { programID: null, chapterID: null, video: null, videoPlayer: null, initComponent: function() { var progID = this.programID; var chapID = this.chapterID; // Set up the video object based on progID and chapID this.videoPlayer = new Ext.Video({ id: "videoPlayer", url: video.URL, posterURL: video.posterURL, fullscreen: true, autoResume: true, // configure listeners for play/end/error }); // Call superclass.initComponent() }, // Create listener callbacks for onPlay, onEnded, onError… }); Ext.reg('videoComponent', MyApp.components.VideoComponent); </code></pre> <p>Does anyone have any ideas on how I can accomplish this?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload