1. #1
    Sencha Premium Member
    Join Date
    Apr 2013
    Location
    NYC
    Posts
    26
    Vote Rating
    2
    Answers
    2
    lrayman is on a distinguished road

      0  

    Default Answered: Inconsistent dirty cell flag in grid numberfield editors?

    Answered: Inconsistent dirty cell flag in grid numberfield editors?


    Using ExtJS 4.2
    I have an editable grid with a bunch of numeric fields. When I edit many of those fields in a row, some of the cells show the dirty flag, and some do not. The cells that do not show the dirty flag are always in the same columns - of the 4 numeric fields, the 1st 2 show the flag, and the rest do not.

    All the fields below have been edited, but not all have the dirty flag:

    editable grid.png

    Any idea as to what I'm doing wrong?

    Code:
        selType: 'cellmodel',
        plugins: [ 'cellediting' ],
        columns: [
             ...
            { text: 'Text Fld 1', dataIndex: 'securityDesc', flex: 1, editor: 'textfield' },
            { text: 'Num Fld 1', dataIndex: 'maxQuantity', editor: {
                xtype: 'numberfield',
                minValue: 1,
                allowDecimals: false,
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }},
            { text: 'Num Fld 2', dataIndex: 'bid', editor: {
                xtype: 'numberfield',
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }},
            { text: 'Num Fld 3', dataIndex: 'Offer', editor: {
                xtype: 'numberfield',
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }},
            { text: 'Num Fld 4', dataIndex: 'Price', editor: {
                xtype: 'numberfield',
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }},
            { text: 'Text Fld 2', dataIndex: 'collCurrency', editor: 'textfield' },
             ...
        ],

  2. I tried with the below code and couldn't get it to fail on 4.2 or 4.2.1.818 Beta (latest Nightly).
    Any chance it fails for you? If so, what ExtJS version are you on?

    Code:
    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['a', 'b', 'c'],
        data:{'items':[
            {"a":1, "b":2, "c":3},
            {"a":1, "b":2, "c":3},
            {"a":1, "b":2, "c":3},
            {"a":1, "b":2, "c":3}
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [{
            name: 'a',
            dataIndex: 'a',
            editor: {
                xtype: 'numberfield',
                minValue: 1,
                allowDecimals: false,
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }
        }, {
            name: 'b',
            dataIndex: 'b',
            editor: {
                xtype: 'numberfield',
                minValue: 1,
                allowDecimals: false,
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }
        }, {
            name: 'c',
            dataIndex: 'c',
            editor: {
                xtype: 'numberfield',
                minValue: 1,
                allowDecimals: false,
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }
        }],
        selType: 'cellmodel',
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,062
    Vote Rating
    215
    Answers
    486
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    I tried with the below code and couldn't get it to fail on 4.2 or 4.2.1.818 Beta (latest Nightly).
    Any chance it fails for you? If so, what ExtJS version are you on?

    Code:
    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['a', 'b', 'c'],
        data:{'items':[
            {"a":1, "b":2, "c":3},
            {"a":1, "b":2, "c":3},
            {"a":1, "b":2, "c":3},
            {"a":1, "b":2, "c":3}
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [{
            name: 'a',
            dataIndex: 'a',
            editor: {
                xtype: 'numberfield',
                minValue: 1,
                allowDecimals: false,
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }
        }, {
            name: 'b',
            dataIndex: 'b',
            editor: {
                xtype: 'numberfield',
                minValue: 1,
                allowDecimals: false,
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }
        }, {
            name: 'c',
            dataIndex: 'c',
            editor: {
                xtype: 'numberfield',
                minValue: 1,
                allowDecimals: false,
                hideTrigger: true,
                keyNavEnabled: false,
                mouseWheelEnabled: false
            }
        }],
        selType: 'cellmodel',
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });

  4. #3
    Sencha Premium Member
    Join Date
    Apr 2013
    Location
    NYC
    Posts
    26
    Vote Rating
    2
    Answers
    2
    lrayman is on a distinguished road

      0  

    Default


    I just found the problem (he said with an embarrassed smile) - I had mistyped some of the dataindex names in the column setup. The badly set-up columns were the ones that didn't show the dirty flag.

    thanks for reply

  5. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,062
    Vote Rating
    215
    Answers
    486
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Ahh... it happens.
    Glad you found the issue.

  6. #5
    Sencha Premium Member
    Join Date
    Apr 2013
    Location
    NYC
    Posts
    26
    Vote Rating
    2
    Answers
    2
    lrayman is on a distinguished road

      0  

    Default debug setting to catch this kind of error?

    debug setting to catch this kind of error?


    One more question:

    Is there a debug setting that would have caught this error?
    The editor code must have been calling get & set methods on the model with an invalid field. It wasn't raising any errors that I could see.

    thanks again for the help

  7. #6
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,062
    Vote Rating
    215
    Answers
    486
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    I'm not sure if it'd catch that particular error, but when developing if you're not using ext-dev.js for your library script do that.

Thread Participants: 1