1. #151
    Sencha Premium Member
    Join Date
    Nov 2010
    Posts
    31
    Vote Rating
    4
    Alexey.Solonets is on a distinguished road

      0  

    Default


    @skirtle

    Sometimes it happens and I actually still not sure why . Look at similar question on stackoverflow: http://stackoverflow.com/questions/1...ting-a-closure

  2. #152
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,590
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    You'll have to forgive my scepticism but I've never observed this behaviour in any browser and it seems unlikely that something so fundamentally broken could make it into a released browser. Even if it did I can't see how a library as complex as ExtJS could possibly work with such a buggy JS engine, it'd collapse in a heap long before reaching that code.

    Even more unlikely is that such a serious bug observed in October 2012 (according to that SO question) would still be present now.

    If you can provide specifics (affected browser version, confirmed browser bug ticket, etc.) I'd be more than happy to change my mind.

    In my opinion a much more likely, albeit uncharitable, explanation is that you're simply misinterpreting what you're seeing.

  3. #153
    Sencha Premium Member
    Join Date
    Nov 2010
    Posts
    31
    Vote Rating
    4
    Alexey.Solonets is on a distinguished road

      0  

    Default


    @skirtle
    Seems like your skepticism is pertinent. I tried to reproduce and had no luck

  4. #154
    Sencha User
    Join Date
    Jul 2007
    Posts
    30
    Vote Rating
    0
    disller is on a distinguished road

      0  

    Default


    @skirtle

    Thanks for the Component Column, but I found a problem for me, because my dataindex has special character, for example :, which can cause Component Column fail.

    Could you please give me any suggestion to fix it except for changing the dataindex.

    Thanks.

  5. #155
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,590
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    @disller. See earlier discussion:

    http://www.sencha.com/forum/showthre...l=1#post997560

    In short, just remove the dataIndex from the config and grab whatever values you need from the record passed to the renderer.

  6. #156
    Sencha Premium Member
    Join Date
    May 2013
    Posts
    21
    Vote Rating
    -2
    harmeet771122 has a little shameless behaviour in the past

      0  

    Default


    Quote Originally Posted by skirtle View Post
    @siebe vos. For a checkbox you might be better off using Ext.ux.CheckColumn, as demonstrated here:

    http://dev.sencha.com/deploy/ext-4.0...l-editing.html

    However, if you did do it using a Component Column it would be something like this:

    Code:
    {
        dataIndex: 'registered',
        text: 'Registered',
        xtype: 'componentcolumn',
        renderer: function(val, meta, record) {
            return {
                checked: val,
                xtype: 'checkbox',
                handler: function(checkbox, checked) {
                    record.set('registered', checked);
                }
            }
        }
    }

    I am trying achieve what you have suggested but I get error when set value to record.

    d.png


    here is code for by check box column

    Code:
    {
                        
                        draggable: false,
                        hideable: false,
                        text: 'Enabled',
                        align: 'center',
                        width: page.ColumnsWidth[3],
                        name: "Enabled",
                        xtype: 'componentcolumn',
                        sortable: true,
                        dataIndex: 'Enabled',
                        renderer: function (name, meta, record, rowIndex) {
    
                            if (record.data.leaf == true) {
                                return {
                                    checked: name,
                                    record: record,
                                    rowIndex: rowIndex,
                                    name: "Enabled",
    
                                    // readOnly: true,
                                    hideable: false,
                                    xtype: 'checkbox',
                                   
                                    listeners: {
                                        click: function () { } ,
                                        change: function (checkbox, newval, oldVal) {
                                        record.set("Enabled", newval);
                                        console.log("Fired");
                                    }
                                    }
                                };
                            }
                            return "";
                        }
                    }

  7. #157
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,590
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I'd guess it's a timing problem and may vary depending on which ExtJS version you're using. Calling set will refresh the row, which destroys the checkbox. However, the checkbox may not yet have finished responding to the click and could attempt to update itself after it has been destroyed.

    Try adding a small buffer or delay to your listener.

  8. #158
    Sencha Premium Member
    Join Date
    May 2013
    Posts
    21
    Vote Rating
    -2
    harmeet771122 has a little shameless behaviour in the past

      0  

    Default


    Quote Originally Posted by skirtle View Post
    I'd guess it's a timing problem and may vary depending on which ExtJS version you're using. Calling set will refresh the row, which destroys the checkbox. However, the checkbox may not yet have finished responding to the click and could attempt to update itself after it has been destroyed.

    Try adding a small buffer or delay to your listener.
    thanks that solution worked. But I am having memory issues now.

    > There are around 200 component (combobox, checkbox).For firefox memory usage is around 40%.Please help on this how can i reduce this.
    > I am using tree grid controls. In which i need check/uncheck parent node to update value of child nodes . When i update a set of child records it takes around 5 seconds. I have tried to put update opration between
    suspendevents and resumeevents for store and suspend layout and resumelayout for grid but his does not seems to work. Any solution to improve perforamnce of group updating records in a store

    >I am using extjs version 4.2.2

  9. #159
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,590
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    If you put together a Sencha Fiddle that demonstrates the problem I'll take a look but from what little information you've provided my best guess is that you're simply pushing the limits of what's possible using this approach. If you have a lot of components it will be slow.

    For updating the checkboxes you could try bypassing the records altogether. Just update the checkboxes and don't set the values on the records. Of course you'll need to apply suitable workarounds elsewhere as the records will no longer be up to date.

  10. #160
    Sencha Premium Member
    Join Date
    May 2013
    Posts
    21
    Vote Rating
    -2
    harmeet771122 has a little shameless behaviour in the past

      0  

    Default


    Quote Originally Posted by skirtle View Post
    If you put together a Sencha Fiddle that demonstrates the problem I'll take a look but from what little information you've provided my best guess is that you're simply pushing the limits of what's possible using this approach. If you have a lot of components it will be slow.

    For updating the checkboxes you could try bypassing the records altogether. Just update the checkboxes and don't set the values on the records. Of course you'll need to apply suitable workarounds elsewhere as the records will no longer be up to date.

    Here is what I am doing to update all the child nodes in treegrid.Updating child nodes result in refreshing view of each row whiich seems to slow down updating process of checking checkbox. Please help me find a soluition . I have tried using ext.suspendLayout, component.suspendlayout, component.suspendEvents but no gain in performance.

    HTML Code:
    //code for checkbox that is recursively updated.
    return Ext.create("Ext.form.field.Checkbox", {
                    checked: checked,
                    record: record,
                    name: "Enabled",
                    fieldCls: record.data.nodeLevel != 2 ? (checked == 1 ? "checkBlue" : (checked == 2 ? "checkBlack" : '')) : "",
                    hideable: false,
                    xtype: 'checkbox',
                    name: "TreeCheckStatus",
    
    
    
    
                    handler: function (checkbox, checked) {
    
    
    
    
                        
                        page.gridPanel.suspendEvents();
                        
                        Ext.defer(function () { record.set("TreeCheckStatus", getTriStatevalue(record)); }, 1);
    //recursive function to update all child notes records
                        updateAllChild(record, getTriStatevalue(record));
                        
                        page.gridPanel.resumeEvents(true);
                     
                    }
                });
    
    
            }
            
            
            
            
            //recursive method to update all the nodes
              function updateAllChild(record, value) {
    
    
                if (record.hasChildNodes()) {
                    // page.gridPanel.suspendLayouts();
                    var childParentStatus = true;
                    Ext.each(record.childNodes, function (rec) {
                        rec.beginEdit();
    
    
    
    
    
    
                        rec.set("TreeCheckStatus", value);
                      
                        updateAllChild(rec, value);
    
    
                        rec.endEdit();
                     
                    });
    
    
                }
    
    
                
            }


    screenshot.png