Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3790
posible bug in edit mode
posted

I recently noticed when double clicking on a cell to enter edit mode the cell inherits data in the top most column?

example grid

12
00
00

If I double click on (row2:col0) my data becomes 1 in that cell, if I ESC to get out its now permanently 1. Same for (row3:col0).

Here is an example of data that causes this

[{"AM":"63.99902","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"}]

Anything I double click on in the AM row assumes 63.99902. If this is not a bug, then would could cause this? My edit starting and started events have no code in them.

FYI: my code has a infragistics suggested work around to the primary key. We dont use the pri key and all of our updates are direct to the TD followed by the JSON data being updated. In order for the code to work right we had to put in a dummy Key and in this case that key would be AM. more info on that here

http://es.infragistics.com/community/forums/p/85055/430952.aspx#430952

Parents
  • 3790
    posted

    Ok I was right its that primary key stuff. I was able to replicate the issue see code.

    please see this http://es.infragistics.com/community/forums/p/85055/430952.aspx#430952 Per this fix I should be able to use the infragistics code without the primary key. Here is another example of it failing to work. Change  primaryKey: "Gain", to primaryKey: "AM", and the code works fine. Please understand ( per that link ) we can not use the pirmary key feature and asked if it were possible to handle updates another way. Setting a null primaryKey value does not work, so it was suggested to put in some random column.

    I'm not sure the primary key is the culprit here but changing it make the problem go away. In the example below the following code will work fine. Chance primaryKey: to "AM" and now double clicking on anything under AM changes the cell data.

     $.ig.loader(function () {
                $("#grid1").igGrid({
                    height: "500px",
                    width: "750px",
                    autoGenerateColumns: false,
                    dataSource: [{"AM":"63.99902","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"},{"AM":"0","Gain":"0.5"}],
                    responseDataKey: "results",
                    dataSourceType: "json",
                    columns: [                    
                        { headerText: "AM", key: "AM", dataType: "string", width: "150px" },
                        { headerText: "Gain", key: "Gain", dataType: "string", width: "150px" }],
                    primaryKey: "Gain",
                    features: [
                        {
                            name: "ColumnFixing",
                            columnSettings: [
                                {
                                    columnKey: "ProductName",
                                    isFixed: true
                                }
                            ],
                            deferredResizing: false,
                            allowDoubleClickToResize: true,
                            columnResizing: function ( )
                            {
                            return false;//dont want this

                            }
                        
                        },
                        {
                            name: "Selection",
                            mode: "cell",
                            multipleSelection: true,
                            mouseDragSelect: true, // default value for selecting multiple cells with the mouse
                            touchDragSelect: true, // default value for selecting multiple cells with a finger
                            cellSelectionChanged: function ( evt, ui )    {},
                            cellSelectionChanging: function ( evt, ui ) {}
                        },
                        {
                            name: "Updating",
                            editMode: "cell",
                            enableAddRow: false,
                            enableDeleteRow: false,
                            startEditTriggers: "dblclick",
                            
                            editCellStarted: function ( evt, ui ){},
                            editCellStarting: function ( evt, ui )
                            {
                            if ( evt.keyCode === 13 )
                            {
                                //document.forms[0].submit();
                                return false;
                            }
                            },
                            
                            editRowEnding: function ( evt, ui ){ },
                            editCellEnded: function ( evt, ui ){}

                        },
                        {
                            name: "Sorting",
                            columnSorting: function ( evt, ui ) {}
                        }
                        
                    ]
                });
            });

Reply Children