Results 1 to 4 of 4

Thread: Get grid from diferent window without id

  1. #1
    Sencha User
    Join Date
    Dec 2013
    Posts
    65
    Answers
    2

    Default Answered: Get grid from diferent window without id

    Hello i am have form with (grid and button), and when i am click button, then open other window, with button, and i am want get grid from 1 window, by click button in 2 window (but i am want do it without 'Id')

    this code 1 window:
    PHP Code:
    {    extend'Ext.grid.Panel',    
    alias'widget.bookwidg',   
     
    title'book',   
     
    name'booklist'
    this function click button fron 2 window:

    PHP Code:
     bookFun: function(button) {      
      var 
    win button.up('window');      
      
    grid win.down('grid'); 
    but i am have error , help me

  2. Do you have any reference to the other window like itemId or special xtype to where you can reference it by using Ext.ComponentQuery.query('#my-item-id') or 'xtype'. If not then assign an itemId to the window and then you can use
    mywindow.down('grid'), or assign an itemId to the grid if you just want the grid.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Do you mean something like this?

    Code:
    var win1 = Ext.widget('window', {
        autoShow: true,
        title: 'Win1',
        height: 250,
        width: 250,
        x: 0,
        y: 0,
        layout: 'fit',
        items: [{
            title: 'myPanel'
        }],
        tbar: [{
            text: 'Move from Win1 to Win2',
            handler: function () {
                var panel = win1.down('[xtype=panel]');
                win1.remove(panel, false);
                win2.add(panel);
            }
        }]
    });
    
    var win2 = Ext.widget('window', {
        autoShow: true,
        title: 'Win2',
        height: 250,
        width: 250,
        layout: 'fit',
        x: 260,
        y: 0
    });

  4. #3
    Sencha User
    Join Date
    Dec 2013
    Posts
    65
    Answers
    2

    Default

    thank you for answer, but this not what I wanted. I am have window with button and grid, and when i am click button i am show other window with button and when i am click this button i want get grid from first window

    i can do this through 'id' var grid = Ext.getCmp('booklist'); but i need do without 'id', use 'name' parametr or something other
    777.JPG

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Do you have any reference to the other window like itemId or special xtype to where you can reference it by using Ext.ComponentQuery.query('#my-item-id') or 'xtype'. If not then assign an itemId to the window and then you can use
    mywindow.down('grid'), or assign an itemId to the grid if you just want the grid.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •