1. #1
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    Lahore
    Posts
    53
    Vote Rating
    -1
    waqar is an unknown quantity at this point

      0  

    Default ExtJs 4.2 Grid Select or Unselect do not work

    ExtJs 4.2 Grid Select or Unselect do not work


    Hi there,
    I had some issues with ExtJs treeGrid I tried almost every thing to properly reload a tree in 4.1 (it was fine in Ext3 and Ext4.0 untill I got ilfated and shifted to 4.1).

    when I exhausted all what google told me and what I found on forums, I dispatched a ticket to sencha support and to my surprise I came to know that in 4.1.* the tree is broken and it would be like re-inventing a wheel and was advised to shift to 4.2 at the time when we were about to release .

    So we had no choice and did a migration and this time grids selection went bad, and we were able to make selection but there was no way to make it "de-selecet" the selected row in tree and in other grids all over the application, I again poked the sencha support and they said its a bug in Grid "again" in new 4.2 ...

    its filed as EXTJSIV-9293.

    reason why I am making thread here is that it must be a problem faced by other Developers out there we can share any hack or a work around if some one has done already or If I in the mean time develop some patch until we can hear some thing from sencha ...


    any help would be appriciated!


    Code:
    var store = Ext.create('Ext.data.TreeStore', {
        root: {
            expanded: true,
            children: [
                { text: "detention", leaf: true },
                { text: "homework", expanded: true, children: [
                    { text: "book report", leaf: true },
                    { text: "algebra", leaf: true}
                ] },
                { text: "buy lottery tickets", leaf: true }
            ]
        }
    });
     
    Ext.create('Ext.tree.Panel', {
        title: 'Simple Tree',
        width: 200,
        height: 150,
        // Problem: but once selected you cant deselect it any more
        allowDeselect: true, 
        store: store,
        rootVisible: false,
         listeners: {
              selectionchange: function(selectionModel, selectedNodesList){
                console.info(selectedNodesList);
              }
            },
     
        renderTo: Ext.getBody()
    });
    EXT Js Developer

  2. #2
    Ext JS Premium Member
    Join Date
    Jun 2011
    Location
    St. Louis
    Posts
    212
    Vote Rating
    9
    jimmylu98 will become famous soon enough

      1  

    Default


    Put allowDeselect: true in the selModel will allow deselect. Not sure what the document say.

    PHP Code:
         selModel: {  allowDeselecttrue 
    So far I don't see extjs 4.2.0 is stable enough ( still many bugs and profermance is still poor) to release our product.

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    Lahore
    Posts
    53
    Vote Rating
    -1
    waqar is an unknown quantity at this point

      0  

    Default


    I was also off the opinion not to go for 4.2 but Sencha support team advised me to do so and now my team is in middle of no where, as they said they had a slightly broke "Tree" package in 4.1.x I will check the way you offered to see if it works.
    EXT Js Developer

  4. #4
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    Lahore
    Posts
    53
    Vote Rating
    -1
    waqar is an unknown quantity at this point

      -1  

    Default


    ok your piece of code does work, in trees, but in grids it takes two clicks to deselect. but I think I have to see the configrations in detail to figure out why.


    Thank yoou very much for guidance.
    EXT Js Developer

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Posts
    15
    Vote Rating
    -2
    soung has a little shameless behaviour in the past

      -1  

    Default


    Quote Originally Posted by waqar View Post
    I was also off the opinion not to go for 4.2 but Sencha support team advised me to do so and now my team is in middle of no where, as they said they had a slightly broke "Tree" package in 4.1.x I will check the way you offered to see if it works.
    i dont understand what you mean.

  6. #6
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    Lahore
    Posts
    53
    Vote Rating
    -1
    waqar is an unknown quantity at this point

      0  

    Default


    The tree package was slightly broke in 4.1(it had bugs) and the bug fixes were offered in 4.2 so we migrated the app to 4.2, but after we migrated we had a test cycle and found out there was another bug (which was not there in 4.1) that we cannot de-select a selected record, and that bug is filed as EXTJSIV-9293.

    I hope now its simple.

    for now jimmylu98 trick works..
    EXT Js Developer

  7. #7
    Ext JS Premium Member
    Join Date
    Jun 2011
    Location
    St. Louis
    Posts
    212
    Vote Rating
    9
    jimmylu98 will become famous soon enough

      1  

    Default


    Quote Originally Posted by waqar View Post
    ok your piece of code does work, in trees, but in grids it takes two clicks to deselect. but I think I have to see the configrations in detail to figure out why.


    Thank yoou very much for guidance.

    1st Click: select a item, 2nd Click same item: deselect the item.

    3.x.x: 1st Click: select a item, use Ctrl Click same item: deselect the item.

    I don't like the 4.x.x implementation at all, since if user 'dbl click' a row will deselect the row - means 'dbl click' action will be very confuse (cannot keep row selected).

    4.2.0 tree still has very serious bug - expand remote tree node will not carry extra param. Wait 4.2.1.



    PHP Code:
    Ext.onReady(function() {
        
    Ext.QuickTips.init();

        
    // sample static data for the store
        
    var myData = [
            [
    '3m Co',                               71.720.02,  0.03,  '9/1 12:00am'],
            [
    'Alcoa Inc',                           29.010.42,  1.47,  '9/1 12:00am'],
            [
    'Altria Group Inc',                    83.810.28,  0.34,  '9/1 12:00am'],
            [
    'American Express Company',            52.550.01,  0.02,  '9/1 12:00am'],
            [
    'American International Group, Inc.',  64.130.31,  0.49,  '9/1 12:00am'],
            [
    'Wal-Mart Stores, Inc.',               45.450.73,  1.63,  '9/1 12:00am']
        ];

        
    // create the data store
        
    var store Ext.create('Ext.data.ArrayStore', {
            
    fields: [
               {
    name'company'},
               {
    name'price',      type'float'},
               {
    name'change',     type'float'},
               {
    name'pctChange',  type'float'},
               {
    name'lastChange'type'date'dateFormat'n/j h:ia'}
            ],
            
    datamyData
        
    });

        
    // create the Grid
        
    var grid Ext.create('Ext.grid.Panel', {
        
    layout'fit',
            
    storestore,
            
    columns: [
                {
                    
    text     'Company',
                    
    flex4,
                    
    sortable false,
                    
    dataIndex'company'
                
    },
                {
                    
    text     'Price',
                    
    flex2,
                    
    sortable true,
                    
    dataIndex'price'
                
    },
                {
                    
    text     'pctChange',
                    
    flex2,
                    
    sortable true,
                    
    dataIndex'pctChange'
                
    },
                {
                    
    text     'Change',
                    
    flex2,
                    
    sortable true,
                    
    dataIndex'change'
                
    }
            ],
        
    columnLinestrue,
            
    height350,
            
    width600,
            
    title'Array Grid',
            
    renderToExt.getBody(),
            
    viewConfig: {   stripeRowstrue  },
        
    selModel: { allowDeselecttrue   }
        });


    }); 

  8. #8
    Sencha User
    Join Date
    Jun 2008
    Posts
    138
    Vote Rating
    7
    jchau is an unknown quantity at this point

      0  

    Default


    We have a similar issue with 4.2. The quality of service and quality of code has really gone down the drain for Sencha ExtJS. 4.x is probably the worst release in their history. The most basics of things are broken. And the way they hype and promote 4.x is like a car salesman selling you a lemon. Hopefully, they can turn it around soon.

  9. #9
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    481
    Vote Rating
    17
    mysticav will become famous soon enough

      0  

    Default


    Does not work under cellmodel, even with allowDeselect: true.

    Code:
     selType: 'cellmodel',
        selModel: {
          allowDeselect: true  
        },
    Any idea how to deselect a cell when using cellmodel (single) ?
    Using Ext with cachefly
    Working on LAMPExt

  10. #10
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    481
    Vote Rating
    17
    mysticav will become famous soon enough

      0  

    Default


    Well, it actually deselects, but the css style is not removed.
    Using Ext with cachefly
    Working on LAMPExt