extjs - Javascript: undefined is not a function -


this code controller:

ext.define(controller.details.studentcontrolller', {     extend: 'ext.app.controller',     requires: [     ],     config: { }, init: function(){ "use strict";         var me = this;         this.app = this.getapplication();     this.createstudenttables(); } createstudenttables: function () { var finalstudent=[], view=this.getstudentstableview();  arrreqtpltest = ['<div class="stureq"><table><tr><th class=" stureq ">' +                 'name  ' +                 '<img src="resources/images/arrow-bottom-1-512.png" width="10px" height="10px" onclick="this.sortstore();"/>' +                 '</th><th class=" stureq ">category ' +                 ' <img src="resources/images/arrow-bottom-1-512.png" width="10px" height="10px" onclick="sortstore();"/>' +                 '</th><th class=" stureq ">student group  ' +                 '<img src="resources/images/arrow-bottom-1-512.png" width="10px" height="10px" onclick="sortstore();"/>' +                 </th></tr></table></div>']; finalstudent.push({ title: “student table”,                 collapsed: true,                 layout: 'fit',                 items: [                     {                         xtype: 'component',                         itemid: 'studenttablviewid-' + i,                         html: arrreqtpltest                      },                     {                         xtype: 'dataview',                         itemid: 'studenttable-' + i,                         height: 200,                         store: ‘studentdetailstore’,                         //itemheight: 70,                         scrollable: false,                                    itemselector: 'div.wrap-requirements-' +                     }                 ]             });         }          view.add(finalstudent); }) } sortstore: function(){         alert("now undefined");     } }); 

in code above can see have written onclick images have attached next column headers. when click on image supposed call function called sortstore keeps throwing error called "uncaught typeerror: undefined not function"

please forgive me if have done syntax errors, because have shortened code make readable. rest assured except sortstore() calling works fine onclick event works fine.

check out fiddle https://fiddle.sencha.com/#fiddle/536

i created panel , attached event listener img element this.

ext.define('test.view.signuppanel', {     extend: 'ext.panel',     xtype: 'mypanel',     config: {       itemid: 'testitem',       layout: 'fit',       html:'<img  src="http://www.sencha.com/img/v2/logo.png"/>',       listeners:{         initialize:function(obj){                 var me= this;                obj.element.down('img').on('tap', me.imagetap, this, me);             }       }     },     imagetap:function(obj){         ext.msg.alert('hi', this.xtype);     } 

});


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -