Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Ukraine
    Posts
    23
    Vote Rating
    0
    ralfius is on a distinguished road

      0  

    Default Checkboxmodel inside grid with editor

    Checkboxmodel inside grid with editor


    Hello,
    looks like I have found a bug in extjs 4.1.1a: in case of using grid with Checkboxmodel and some editor for cell there happens deselection of all nonactive rows and selecting only active(editing) row.
    Code:
    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'phone'],
        data:{'items':[
            {"name":"Lisa", "email":"lisa@simpsons.com", "phone":"555-111-1224"},
            {"name":"Bart", "email":"bart@simpsons.com", "phone":"555-222-1234"},
            {"name":"Homer", "email":"home@simpsons.com", "phone":"555-222-1244"},
            {"name":"Marge", "email":"marge@simpsons.com", "phone":"555-222-1254"}
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        selModel: Ext.create("Ext.selection.CheckboxModel", {
            checkOnly : true
        }),
        columns: [
            {header: 'Name',  dataIndex: 'name', editor: 'textfield'},
            {header: 'Email', dataIndex: 'email', flex:1,
                editor: {
                    xtype: 'textfield',
                    allowBlank: false
                }
            },
            {header: 'Phone', dataIndex: 'phone'}
        ],
        selType: 'cellmodel',
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Vote Rating
    751
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Not truly a bug IMO. When you select a row outside the checkbox (in another column) it will only select that row, multi selection is only if you click on the check box so when you try to edit it will have the same behavior as you are click on outside the checkbox. You can give the mode to the selection model to multi or simple but when you try to start edit it will toggle the selection on and off.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    3
    Vote Rating
    0
    humilify is on a distinguished road

      0  

    Default checkbox models and cellediting clash!

    checkbox models and cellediting clash!


    Quote Originally Posted by mitchellsimoens View Post
    Not truly a bug IMO. When you select a row outside the checkbox (in another column) it will only select that row, multi selection is only if you click on the check box so when you try to edit it will have the same behavior as you are click on outside the checkbox. You can give the mode to the selection model to multi or simple but when you try to start edit it will toggle the selection on and off.
    I find your reply confusing.
    If I have a multi-selection checkbox grid; (checkbox models are normally multi-select). I set checkOnly : true
    Are you saying that when I activate cellediting on another column, it must interfere with the checks I have selected?
    4.1.1 did not have the issue, 4.1.3 still has the problem. I think this is a big problem. Test the code again. Please explain.

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    20
    Vote Rating
    0
    FCGus is on a distinguished road

      0  

    Default


    Not sure if any solution exists for this...I have a similar issue using extjs 4.1.1
    I have an editable grid with a checkboxselection model the checkOnly attribute is set to true.
    When I click in an editable cell and then tab over to the next editable cell the row is getting selected.

    As a result the logic that I have in the select listener is getting executed for the row something that I want to execute only when the check box is selected not when I tab over to the next editable cell/column.

    Any suggestions?

    Thanks,
    Gus

  5. #5
    Sencha User
    Join Date
    May 2013
    Posts
    1
    Vote Rating
    0
    grekpe is on a distinguished road

      0  

    Default


    I too came across this problem and did the following:
    Code:
    var clickedColumnIndex = -1;
    Ext.create('Ext.grid.Panel', {
            (...)
        listeners: {
            "cellclick": function (sender, td, cellIndex, record, tr, rowIndex, e, eOpts) {
                clickedColumnIndex = cellIndex;
            },
            "beforedeselect": function (rowmodel, record, index, eOpts) {
                return (clickedColumnIndex === 0); //prevents deselecting all rows when editing other cells
            }
        },
        selModel: Ext.create('Ext.selection.CheckboxModel', { checkOnly: true, mode: 'MULTI' }),
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ]
    });
    So basically I just added listeners for 'cellclick' (in wich I save the column number of the clicked cell) and 'beforedeselect' (which returns false if the column no is not 0). Not sure if it's the best solution but it helped in my case.

  6. #6
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    20
    Vote Rating
    0
    FCGus is on a distinguished road

      0  

    Default


    Thanks for the reply, I did end up doing something similar, I used the statement in the beforeselect and beforedeselect listeners:

    if (Ext.getCmp('PORInquiryGrid').editingPlugin.activeColumn != null &&
    Ext.getCmp('PORInquiryGrid').editingPlugin.activeColumn.dataIndex != null)
    {
    return false;
    }

    On the other hand when I tried using the arrow keys to navigate through the editable grid the same issue happened again i.e. the row got selected and I could not figure a way to workaround that.
    It is kind of frustrating for some of the configuration options not to work and there is no clear workaround.

  7. #7
    Sencha User
    Join Date
    Jan 2013
    Posts
    1
    Vote Rating
    0
    mihailo.joksimovic is on a distinguished road

      0  

    Default


    @grekpe Thanks for sharing your solution, it's working great (using ExtJS 4.2.1).

    However, I think it would make sense to add some property to CheckboxSelection Model that would force user to (un)check the Checkbox in order to change the selection.

    The way it is now is really frustrating IMO :-)

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