Calling EXTJS from another Javascript

Posted by rose on January 6th, 2009
  • hi,

    i have situvation where i have to call the grid data load function

    ds.load({params:{start: 0, limit: 50}});

    from a function outside Ext.onReady as show below is sample code.
    Any help how to call a function inside EXT.onReady...

    Thanks in Advance.
    -Deepen


    #############################
    function removerid(x)
    {
    alert(x);
    ds.load({params:{start: 0, limit: 50}}); // I am unable call DS from ouside EXT
    }


    Ext.onReady(function(){

    Ext.QuickTips.init();
    // Ext.form.Field.prototype.msgTarget = 'side';
    ///////////////////////////////////////////////////


  • Where global function removerid is defined outside Ext.onReady, give your important components (your Grid: 'myGrid') an ID so they accessible globally:


    function removerid(x){
    var grid ;
    if(grid = Ext.getCmp('myGrid') && grid.rendered ){ //may not be rendered yet.
    grid.getStore().load({params:{start: 0, limit: 50}});
    }
    }


  • thanks its working.:-)

    we need to use
    id : mygrid

    and not with :: var mygrid = new Ext.grid.GridPanel({


    but with
    var mygrid = new Ext.grid.GridPanel({
    id : 'mygrid'


    Thanks one again.


  • I'm trying to do the same thing, but I get the error: "grid has no properties"

    var grid;
    if(grid = Ext.getCmp('budgetGrid') && grid.rendered()){ //may not be rendered yet.
    grid.getStore().reload();
    grid.doLayout();
    }


  • I'm trying to do the same thing, but I get the error: "grid has no properties"
    This works fine for me:
    var grid;
    if(grid = Ext.getCmp('budgetGrid') && grid.rendered()){ //may not be rendered yet.
    grid.getStore().reload();
    grid.doLayout();
    }







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Calling EXTJS from another Javascript , Please add it free.