How would I fire an event (I am wanting to switch card views) from a plain old html link?
If I reference the link by ID in my controls section no event I tried (click, tap) seems to be triggered.
Thanks!
How would I fire an event (I am wanting to switch card views) from a plain old html link?
If I reference the link by ID in my controls section no event I tried (click, tap) seems to be triggered.
Thanks!
Once you render the link you can add event listener in this way:
Ext.get( [link id here] ).on( click , function(){...}, this);
UPDATE
If you want to fire an event once user clicked on hyperlink, you can simply add this.fireEvent( [name of event here] );
but be aware of this
keyword meaning in this function, so you ll have an ability to add listener to it properly... Does it make sense?
Add a click listener to the panel containing the link. In the example the tag has the link class. You can substitute it by your own class/id, as it s done in jQuery.
listeners: {
scope: this,
itemtap: this.onItemtapAction,
click: {
element: el ,
fn: function (e) {
if (e.getTarget( a.link )) {
// Switch cards here
}
}
}
I used simple Java Script to add a listener to the link.
First, I created an "activate" listener for the container component:
...
listeners: {
activate: function (newActiveItem, container, oldActiveItem, eOpts) {
this.onActivate(newActiveItem, container, oldActiveItem, eOpts);
}
}
...
And here is my function:
onActivate: function (newActiveItem, mainNavView, oldActiveItem, eOpts) {
var me = this;
document.getElementById( logOutLink ).addEventListener("click",
function(){
me.onLogOut();
}, false);
},
onLogOut:function(){
alert( log out );
}
I am using ExtJS 3 here. I would like to populate a formpanel from database with fields to be submitted. Basically, I don t know witch fields my form will have and I want to generate all formpanel ...
I am planning to use Ext JS for a large application. The application s features are role based. When user login, they only see menu and screen features related to them. My server side technology will ...
I have a Panel layout with a TreePanel in one region. A user clicks on an node in the tree and a TabPanel should be displayed in another region with information, editing tools etc. for that tree node....
I have some issues with Json result and embed it within the html of the Extjs Panel. Here s that I have managed to get so far. myPanel is embedded within a mainPanel, and I have some shows/hide of ...
I am using ExtJS. One of the textfield made with ExtJS component should allow comma separated number/opeator strings (3 similar examples) like 1, 2-3, 4..5, <6, <=7, >8, >=9 >2, 3..5,...
I need to keep certain data ( in a grid) up to date and was gonna do a poll to the server every 15 seocnds or so to get the data and refresh the grid, however it feels a bit dirty ( the grid will have ...
All the ExtJS documentation and examples I have read suggest calling superclass methods like this: MyApp.MyPanel = Ext.extend(Ext.Panel, { initComponent: function() { // do something MyPanel ...
Is it possible to have two headers in Ext JS grids? I have to show my grid as grouped data.. for example product types and products. In my case I need a grid like this: Field | Product Type A ...