1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    47
    Vote Rating
    0
    softm is on a distinguished road

      0  

    Default How to get ext.grid column model from outside ext JS (jquery on click)

    Need hide/show column of ext grid, depending on external factors, not related to grid store.
    Now i try simple thing:


    Code:
      $(document).ready(function(){
    
    
        // =================== hide column/show column ========================
        function show_announce()
        {
           Ext.namespace('Ext.ux');
           Ext.namespace('Ext.ux.form');
    
    //       $.log( Ext.grid.getColumnModel() );
    //       $.log( grid.getColumnModel() );
    //       $.log( Ext.ux.grid.getColumnModel() );
           $.log( grid.getColumnModel() );
        }
    
              
        // ===================
        $( "#test-test" ) . click( function(){
           show_announce();
           return false;
        });
      });


    But every variant of call this column model i try:


    Ext.grid.getColumnModel()
    grid.getColumnModel()
    Ext.ux.grid.getColumnModel()
    grid.getColumnModel()

    is incorrect.


    But, i can reload store from this same function with store.reload();

    Dear developers and EXT users!
    Please help me to hide or show column from JS.
    Or get column model of extjs grid is inided and is active!


    Arsen

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    47
    Vote Rating
    0
    softm is on a distinguished road

      0  

    Default

    it was global scope problemm of column model & grid vars. Both must be in glob.scope, ie without vars ...
    So then start working
    pls delete this ...

  3. #3
    Sencha User poojagarg89's Avatar
    Join Date
    Sep 2011
    Location
    Ahmedabad,India
    Posts
    213
    Vote Rating
    0
    poojagarg89 is on a distinguished road

      0  

    Default On clickin of leaf node of tree.Panel need to hide and show diff. grids?

    hey guys help me out...........
    I have two grids with diff. column names n diff. forms for them and I want to make the grids hide() and show() when I click on tree.Panel......leaf nodes.......

    like I have two leaf nodes under Admin that is : bulletin_users for grid1
    and announcements for grid2

    So I want wen i click on bulletin_users the grid1 should be visible with its respective toolbar in the ContentPanel and the grid2 should be hidden with its respective toolbar.........and viceversa wen I click on announcements


    tell me the code which I should put into the listeners of TreePanel.

  4. #4
    Sencha User davisty's Avatar
    Join Date
    Mar 2010
    Location
    Spanish Fort, Al
    Posts
    277
    Vote Rating
    1
    davisty is on a distinguished road

      0  

    Default

    Hello,

    Ive used xtemplate to generate the html. Setting the id/class within the xtemplate that jquery will then access when the onclick is accessed.

  5. #5
    Sencha User poojagarg89's Avatar
    Join Date
    Sep 2011
    Location
    Ahmedabad,India
    Posts
    213
    Vote Rating
    0
    poojagarg89 is on a distinguished road

      0  

    Default

    Hey can U give me the code like how to use it actually M just a beginner and I searched for it but not getting how to apply in my code

  6. #6
    Sencha User davisty's Avatar
    Join Date
    Mar 2010
    Location
    Spanish Fort, Al
    Posts
    277
    Vote Rating
    1
    davisty is on a distinguished road

      0  

    Default

    Im not in a position to get it for you now, but check this link out. It is kinda along the same thingy ...

    http://demo.superdit.com/ext_listview_dataview/

    Basically, your just building an html table with the xtemplate, then you access the id(s)/classes using jquery ...

    Hope this helps.

Similar Threads

  1. Open a Model window with the details of the Grid Row when I click the grid row
    By shonekolathu in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 11 Jan 2011, 1:47 PM
  2. Grid Column Model
    By tutankamen in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 13 Jan 2010, 4:14 AM
  3. Ext js 2.0 ( How to get a checkbox in grid column model
    By cprabha in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 31 Jul 2008, 6:07 AM

Thread Participants: 2