Showing posts with label Extjs 4. Show all posts
Showing posts with label Extjs 4. Show all posts

Thursday, 18 July 2013

How to Handle grid selection model in accordion layout in collapsed mode.

How to Handle grid selection model in accordion layout in collapsed mode.

Problem:   I have three grid which  are within accordion layout. I have to select the record in gird which is collapsed mode first time view is loaded.



We are getting error as view is not available in  collapse mode.

Solution : we need to handle like below code. Need to add listener to grid to select the grid data after grid expanded first time.

Source Code:

    if (grid.collapsed !== true) {
         grid.getSelectionModel().select(recordArray, true, false);
    } else {
      grid.addListener('expand', function() {
         grid.getSelectionModel().select(recordArray, true, false);
         }, grid, {
             single: true
         });
    }

Monday, 8 April 2013

How to avoid showing old data on extjs comobox while querying.

Problem:  When I click on combobox. It shows the old data in blur before it display new data. Some time it does not  allow me to select  the combobox.  Those kind of issue will appear only when you load combobox as raw static data and then try to load using query.

Solution:

        xtype: 'combobox',
        name: 'interNalFaeId',
        itemId: 'interNalFaeId',
        fieldLabel: 'Arrow FAE',
        editable: false,
        listeners: {
          beforequery: function(queryEvent) {
            if (queryEvent.combo.lastQuery !== queryEvent.query) {
              queryEvent.combo.store.removeAll();
            }
          },
          scope: me

        }