Friday, 20 November 2015

Extjs: Difference between listner and handler

While working with Extjs. In most of the components i defined the handler which can fire an  Event.
Will enplane the button Events as

Handler:  handler is associated with a Component Action. click the component is the primary event Event of the button. this will handles the Handler's operation, it is the Component of the first Event responsive function on the Event.



     xtype: 'button',
            id:'btnTestEvents',
            text: 'Test Events',
            handler: function () {
            Ext.Msg.show({
                     title: 'Events Test Confirmation',
                     msg: 'Test message',
                     buttons: Ext.Msg.YESNO,
                     icon: Ext.Msg.QUESTION,
                     fn: function(btn) {
                       switch (btn) {
                         case "yes":
                               //do something
                               break;
                          case "no":
                               break;
                                  }
                                      }
            });


}

Listener: Listner is the maily event handler and combination. Examples of button events like "Click", "focus", "blur".
Event associated with the listener, can be easily Event Management.



     xtype: 'button',
            id:'btnTestEvents',
            text: 'Test Events',
            listeners: {
                     click: function( field, e, eOpts )
                                            {

                               },
                     focus:
function(field, event, eOpts )
                                            {
           
                             }
}






Tuesday, 17 November 2015

Extjs After App build using Sencha cmd bootstrap.json not found

Hello,

Recently we did generated the application using sencha CMD after that while opening of the application giving the following Error message coming as bootstrap.json Not found.






First we need to find out the bootstrap.json location in bootstrap.js and verify that bootstrap.json is there in the specified location and If the file is there in the given location Open the IIS.

Go to your website in Feature View click on the MIME Type.























Verify the .json MIME type is there or not. If it is not there Add Using Add MIME type Window.

















Monday, 16 November 2015

Extjs 4: How to clear tree nodes

There are two ways to remove the tree panel nodes.

Either we need to reload the treepanel store.



        getCmp('treePanelId').getStore().load();


Where treepanelId is the Id of tree. If you have the storeId then you can directly store.load() to remove the childs.

Removing the Child  Nodes is not necessary to reload the store.



        getCmp('treePanelId').getRootNode().removeAll();