1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    754
    Vote Rating
    1
    franklt69 is on a distinguished road

      0  

    Default trouble using Grid and LayoutDialog with a grid?

    trouble using Grid and LayoutDialog with a grid?


    Hi I have a page where I have a Grid it appear right (Page1), in the toolbar of grid, I add a button to show a layoutdialog, inside the layoutdialog I have other grid, if I set comment in the gridSearchCondition.render(); the grid in page1 appear right but if I remove the comments then some datas in the column of grid in Page1 dissapear, what is wrong?


    this grid is in Page1

    var XmlExample = function(){
    return {
    init : function(){
    // limit selection in the grid to one row
    // start initializing grid
    sm = new YAHOO.ext.grid.SingleSelectionModel();
    // listen for selection changes
    sm.addListener('selectionchange', this.onSelection);
    var colModel = new YAHOO.ext.grid.DefaultColumnModel([
    {header: "ExternalId", width: 120, sortable: false},
    {header: "Name", width: 120, sortable: true, locked: true},
    {header: "Address", width: 180, sortable: true},
    {header: "City", width: 115, sortable: true},
    {header: "State", width: 100, sortable: true},
    {header: "Zip", width: 80, sortable: true},
    {header: "Phone", width: 100, sortable: true},
    {header: "Fax", width: 100, sortable: true},
    {header: "Mobil", width: 115, sortable: true},
    {header: "Email", width: 200, sortable: true}
    ]);
    //colModel.defaultSortable = true;
    dataModel = new YAHOO.ext.grid.XMLDataModel({
    tagName: 'Rows',
    totalTag: 'TotalCount',
    id: 'ExternalId',
    fields: ['ExternalId', 'Name', 'Address', 'City', 'State', 'Zip', 'Phone', 'Fax', 'Mobil', 'Email']
    });
    dataModel.addListener('load', sm.selectFirstRow, sm, true);
    // initialize paging
    dataModel.initPaging('HandlerContact.ashx', 10);
    dataModel.baseParams['value'] = value;
    dataModel.baseParams['typeSearch'] = typeSearch;
    dataModel.baseParams['operator'] = operator;
    dataModel.baseParams['attribute'] = attribute;
    dataModel.baseParams['condition'] = condition;
    dataModel.setDefaultSort(colModel, 1, 'ASC');
    // create the Grid

    grid = new YAHOO.ext.grid.Grid('example-grid', dataModel, colModel, sm);
    grid.render();
    // the grid is ready, load page 1 of topics

    var toolbar = grid.getView().getPageToolbar();
    toolbar.addSeparator();
    //toolbar.addButton({ className: 'new-topic-button', text: "New Topic", onNew.createDelegate(this)});
    //toolbar.addButton({id:'btnDelete', text: '', className: 'navDelete', tooltip: 'Delete Current Record', click: this.showAddFeed.createDelegate(this)});

    toolbar.addButton({id:'btnNew', text: '', className: 'navNew', tooltip: 'New Contact', click: this.onNew.createDelegate(this)});
    toolbar.addButton({id:'btnEdit', text: '', className: 'navEdit', tooltip: 'Edit Current Record', click: this.onEdit.createDelegate(this)});
    toolbar.addButton({id:'btnDelete', text: '', className: 'navDelete', tooltip: 'Delete Current Record', click: this.onDelete.createDelegate(this)});
    toolbar.addSeparator();
    toolbar.addButton({id:'btnFind', text: 'Find', className: 'doFind', tooltip: 'Find Contacts', click: this.onClickShowFindDlg.createDelegate(this)});
    dataModel.loadPage(1);
    grid.getColumnModel().setHidden(0, true);
    grid.addListener('rowdblclick', this.onCelldblClick, this, true);
    grid.addListener('cellclick', this.onCellClick, this, true);
    },

    onClickShowFindDlg : function(){
    Search.init();
    },
    onSelection : function(){
    selectRowId = grid.getSelectedRowId();
    currentRowIndex = grid.getSelectedRowIndex();
    }

    } //end init

    }();

    YAHOO.ext.EventManager.onDocumentReady(XmlExample.init, XmlExample, true);



    the js in the layout:

    var Search = function(){
    var findDlg;

    return {
    init : function(){
    YAHOO.ext.state.Manager.setProvider(new YAHOO.ext.state.CookieProvider());
    if(!findDlg){ // lazy initialize the findDlg and only create it once
    findDlg = new YAHOO.ext.LayoutDialog("findDlg", {
    modal:true,
    width:650,
    height:300,
    shadow:true,
    minWidth:300,
    minHeight:300,
    syncHeightBeforeShow: true,
    fixedcenter: true,
    center: {
    titlebar: false,
    autoScroll:true,
    tabPosition: 'top',
    closeOnTab: false,
    alwaysShowTabs: false,
    resizeTabs: true

    },
    south: {
    split:true,
    initialSize: 150,
    minSize: 150,
    maxSize: 200,
    titlebar: true,
    collapsible: true,
    title: 'Find & Save Conditions',
    animate: true
    }
    });

    findDlg.addKeyListener(27, findDlg.hide, findDlg);
    //findDlg.addButton('Close', findDlg.hide, findDlg);
    // findDlg.addButton('Submit', findDlg.hide, findDlg);
    // findDlg.addButton('Submit', this.showAddFeed, this);
    var layout = findDlg.getLayout();
    findDlg.beginUpdate();
    //begin update

    ......


    //end update
    layout.restoreState();
    findDlg.endUpdate();
    /*******************gridSearchCondition sections *************************/
    //getting the data to populate gridSearchCondition in conditions section
    smSearch = new YAHOO.ext.grid.SingleSelectionModel();
    var cmSearch = new YAHOO.ext.grid.DefaultColumnModel([
    {header: "ExternalId", width: 15, sortable: false, hidden: true},
    {header: "Name", width: 180, sortable: true},
    {header: "Description", width: 180, sortable: true},
    {header: "Condition", width: 300, sortable: true},
    {header: "Context", width: 15, sortable: false, hidden:true},
    {header: "AValue", width: 15, sortable: false, hidden:true},
    {header: "Attribute", width: 15, sortable: false, hidden:true},
    {header: "Operator", width: 15, sortable: false, hidden:true},
    {header: "SearchType", width: 15, sortable: false, hidden:true}

    ]);

    dmSearch = new YAHOO.ext.grid.XMLDataModel({
    tagName: 'Rows',
    totalTag: 'TotalCount',
    id: 'ExternalId',
    fields: ['ExternalId', 'Name', 'Description', 'Condition', 'Context', 'AValue', 'Attribute', 'Operator', 'SearchType']
    });
    dmSearch.addListener('load', smSearch.selectFirstRow, smSearch, true);
    dmSearch.setDefaultSort(cmSearch, 1, 'ASC');

    var gridSearchCondition = new YAHOO.ext.grid.Grid('condition-grid', dmSearch, cmSearch, smSearch);
    gridSearchCondition.render();
    dmSearch.load('HandlerSearch.ashx');
    /*******************gridSearchCondition sections *************************/

    }//if

    findDlg.show();

    } //end init

    }();


    kind regards
    Frank

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    754
    Vote Rating
    1
    franklt69 is on a distinguished road

      0  

    Default


    if I show all columns in the grids (don't hidden any column) the LayoutDialog appear ok, but in the grid in the page1, the data disappear in some columns when I close the dialog, if I resize some column the grid is repaint and then appear again the data, so How I can do a refresh or repaint of grid for code?

    kind regards
    Frank

Similar Threads

  1. trouble passing grid info via seletionchange
    By pjordan in forum Ext 1.x: Help & Discussion
    Replies: 9
    Last Post: 16 Mar 2007, 4:33 AM
  2. Combo box, layoutdialog and grid
    By franklt69 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 15 Mar 2007, 7:09 AM
  3. Trouble adding rows to grid manually.
    By kjordan in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 9 Mar 2007, 3:22 PM
  4. Grid layout trouble
    By Belgabor in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 25 Feb 2007, 3:21 PM
  5. Trouble getting started with Grid and XML
    By Rich in forum Ext 1.x: Help & Discussion
    Replies: 15
    Last Post: 18 Nov 2006, 4:45 PM

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar