Saturday, June 23, 2012

ExtJS4.1: gridPanel Scroll problem

It you have a gridPanel that it's scroll bar is not been shown .Look if you have the layout: 'absolute' config value set and try deleting that config parameter. That worked.for me.


Before:
Ext.define('WebMonitorClass.view.PlanillaActivacionGridPanel', {    
    extend: 'Ext.grid.Panel'
    ,alias: 'widget.planillaActivacionGridPanel'
    ,layout: 'absolute'
    ,frame:true
    ,columnLines: true    
    ,store: Ext.create('Ext.data.ArrayStore', {
        fields: [
           {name: 'column1',     type: 'string'}
           ,{name: 'column2',     type: 'string'}                      
        ],
        data: [['data 11','data12'],
                ['data 21','data22'],
            ]})
        ,x:0
        ,y:0
        ,height: 200
        ,width: 150
        ,columns: [
            {
                text     : 'Column 1',                
                sortable : false,
                width    : 75,
                dataIndex: 'column1'
            },{
                text     : 'Column2',              
                sortable : false,
                width    : 105,
                dataIndex: 'column2'
            }
        ]          
    ,initComponent: function() {                                                    
        this.callParent();        
    }    
    ,items: []
});


After (Scroll Works Perfectly)
Ext.define('WebMonitorClass.view.PlanillaActivacionGridPanel', {    
    extend: 'Ext.grid.Panel'
    ,alias: 'widget.planillaActivacionGridPanel'
    //,layout: 'absolute' // with layout:absolute the scroll doesn't work           
    ,frame:true
    ,columnLines: true    
    ,store: Ext.create('Ext.data.ArrayStore', {
        fields: [
           {name: 'column1',     type: 'string'}
           ,{name: 'column2',     type: 'string'}                      
        ],
        data: [['data 11','data12'],
                ['data 21','data22'],
            ]})
        ,x:0
        ,y:0
        ,height: 200
        ,width: 150
        ,columns: [
            {
                text     : 'Column 1',                
                sortable : false,
                width    : 75,
                dataIndex: 'column1'
            },{
                text     : 'Column2',              
                sortable : false,
                width    : 105,
                dataIndex: 'column2'
            }
        ]          
    ,initComponent: function() {                                                    
        this.callParent();        
    }    
    ,items: []
});


Reference:
http://docs.sencha.com/ext-js/4-1/#!/example/grid/grid-plugins.html

Thursday, June 21, 2012

EXTJS4: not-editable textfield

Add readOnly boolean config parameter:

,readOnly:true


for example:

                     {
                            xtype:'textfield'                                                        
                            ,x:830
                            ,value:"MyDefaultvalue"
                            ,readOnly:true
                            ,y:40
                            ,width:220                           
                        }


Reference:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.field.Text-cfg-readOnly

Tuesday, June 12, 2012

Apache: Faulting application httpd.exe, version 2.2.4, faulting module OraOCIEI11.dll, version 0.0.0.0

If your apache server suddenly restarts and your windows event viewer gets an error like this:

Faulting application httpd.exe, version 2.2.4, faulting module OraOCIEI11.dll, version 0.0.0.0


Try updating your Oracle Instant Client version.

Ie. In the server I had Version 11.1.0.6.0 and I delete that one and I installed version Version 11.2.0.2.0


That solved the problem :D

Resources:
https://forums.oracle.com/forums/thread.jspa?threadID=2327291

Friday, May 4, 2012

Mysql 5 : Installation in Windows 7 - Error 1067 El proceso ha terminado de forma inesperada MySQL

If you try to install mysql 5 in windows 7 and you get the following error

"Error 1067 El proceso ha terminado de forma inesperada MySQL"

Search and delete the files "ib_logfile0" and "ib_logfile1" in the installation directory ( usuarlly "C:\Program Files (x86)\MySQL\MySQL Server 5.0\data")

Reference:

Monday, April 23, 2012

JQuery: parse json text to json Object


var obj = jQuery.parseJSON('{"name":"John"}');
alert( obj.name === "John" );


Reference:
http://api.jquery.com/jQuery.parseJSON/

GSON: map to json string simple example


import com.google.gson.Gson;
...
...
Map<String,Object> modelMap = new HashMap<String,Object>();
modelMap.put("message", "welcome");
modelMap.put("success", false);
modelMap.put("data", new Object());                                    


Gson gson = new Gson();
String jsonOutput = gson.toJson(modelMap); // {"message":"welcome","data":{},"success":false}


Resources:
http://blog.pontt.com/json-con-java/introduccion-java-y-json-primera-parte-con-ejemplo/
http://code.google.com/p/google-gson/