Note that there are some explanatory texts on larger screens.

plurals
  1. POSencha 2 - displaying null value in nested List
    primarykey
    data
    text
    <p>I am new to sencha. I am developing an app using treestore and nestedList. I am unable to load data returned from a coldfusion component.it shows null.</p> <p>Here is my Viewport.js:</p> <pre><code>Ext.define('Myapp.view.Viewport', { extend: 'Ext.tab.Panel', xtype:'newviewport', config: { fullscreen: true, tabBarPosition: 'top', html: 'hiiiiiiiiiii', cls:'test', items: [ { title: 'Sections', iconCls: 'home', xtype: 'sectionslist' } ] } }); </code></pre> <p>My store:samplestore.js</p> <pre><code>Ext.define('Myapp.store.samplestore', { extend: 'Ext.data.TreeStore', config: { autoLoad: true, model: 'Myapp.model.sampleModel', proxy: { type: 'ajax', url: '/sample/sample1.cfc?method=getSections', reader: { type: 'json', rootProperty:'DATA' } } } </code></pre> <p>});</p> <p>My model: sampleModel.js</p> <pre><code> Ext.define("Myapp.model.sampleModel", { extend: "Ext.data.Model", config: { fields: [ {name: 'LoginID', type: 'string'}, {name: 'FIRSTNAME', type: 'string'} ] } }); </code></pre> <p>My sample1.cfc :</p> <pre><code> &lt;cfcomponent name="sample" output="false"&gt; &lt;cffunction name="getSections" output="no" returnformat="json" access="remote"&gt; &lt;cfquery name="qryGetDetails" datasource="#request.dsn#"&gt; SELECT TOP 5 LoginID, FIRSTNAME FROM tblUser &lt;/cfquery&gt; &lt;cfreturn qryGetDetails&gt; &lt;/cffunction&gt; &lt;/cfcomponent&gt; </code></pre> <p>My Sectionslist.js</p> <pre><code>Ext.define('Myapp.view.Sectionslist', { extend: 'Ext.dataview.NestedList', xtype: 'sectionslist', config: { store: 'samplestore' itemTpl: [ '{FIRSTNAME}&lt;br/&gt;' ].join(''), onItemDisclosure: function(record, btn, index) { console.log("worked"); } }, //getItemTextTpl: function(node) { //console.log(node); // return node.data.FIRSTNAME+ ':&lt;strong&gt;&lt;/strong&gt;'; // } }); </code></pre> <p>And finally my json data:</p> <pre><code> {"COLUMNS":["LOGINID","FIRSTNAME"],"DATA":[["bt","Jn"],["jr","Jy"],["b20","Best"],["jman","Jeff"],["fenad","Fn"]]} </code></pre> <p>PLease help to find out my problem, I cant trigger where i went wrong, I am getting null value, as displaying data is wrong.: itemTpl: [ '{FIRSTNAME}<br/>' ].join(''), </p> <p>Instead of Firstname ,what should i display here??? I tried many methods, but no use, please help.....</p>
    singulars
    1. This table or related slice is empty.
    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.
    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