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
1460
If hidden column is before any other columns, ui object of click events incorrect
posted

I added a hidden column as the first column of my column definition. When I clicked the first column which is the 'NextRound' column in the code below, the ui.colKey is for the hidden column 'CompetitionRoundEntryID'.  I was able to work around this temporarily by moving the hidden column to the end, but it seems like if this type of issue is present in the grid that it's not ready for prime time yet.

 

grid.igGrid(                 { columns: [  
{ headerText: "CompetitionRoundEntryID", key: "CompetitionRoundEntryID", dataType: "string", hidden: true },                          
{ headerText: "Finals", key: "NextRound", dataType: "bool" },                            
{ headerText: "Competitor", key: "Competitor", dataType: "string" },                            
{ headerText: "Partner", key: "Partner", dataType: "string" },                            
{ headerText: "J1", key: "J1", dataType: "number" , },                            
{ headerText: "J2", key: "J2", dataType: "number" },                            
{ headerText: "J3", key: "J3", dataType: "number" },                            
{ headerText: "J4", key: "J4", dataType: "number" },                            
{ headerText: "J5", key: "J5", dataType: "number" },                            
{ headerText: "", key: "DIVIDER", dataType: "string", width:10 },                            
{ headerText: "1", key: "1", dataType: "number" , },                            
{ headerText: "2", key: "2", dataType: "number" },                            
{ headerText: "3", key: "3", dataType: "number" },                            
{ headerText: "4", key: "4", dataType: "number" },                            
{ headerText: "5", key: "5", dataType: "number" },],                    
features: [{                             name: "Sorting",                             type: "local"                         },                        
{ name: "Selection",                             mode: "cell",                             multipleSelection: false,                             activation: true                         },                        
{ name: 'Updating',                             editMode: 'cell',                             enableAddRow: false,                             enableDeleteRow: false                         }],                     width: "500px",                     dataSource: Competition.CompetitionRoundEntries ,                    
autoGenerateColumns: false,                    
renderCheckboxes: true,                    
cellClick: function(evt, ui){debugger;                        
if(ui.colKey==='NextRound'){                            
$(this).igGridSelection('selectCell', ui.rowIndex, ui.colIndex);
$(this).igGridUpdating('startEdit', ui.rowIndex, ui.colIndex);                             var myVal = $(this).igGridSelection('getCellValue', ui.rowIndex, 'NextRound');                             $(this).igGridUpdating("setCellValue", ui.rowIndex, 'NextRound', !myVal);                         }

                    }

                });

 

 

Competition.CompetitionRoundEntries = [        
{ 'CompetitionRoundEntryID': 1, 'NextRound': false, 'Competitor': 'Some Competitor 1', 'Partner': 'Some Partner 1', 'J1': '', 'J2': '', 'J3': '', 'J4': '', 'J5': '' },         { 'CompetitionRoundEntryID': 2, 'NextRound': false, 'Competitor': 'Some Competitor 2', 'Partner': 'Some Partner 2', 'J1': '', 'J2': '', 'J3': '', 'J4': '', 'J5': '' },         { 'CompetitionRoundEntryID': 3, 'NextRound': false, 'Competitor': 'Some Competitor 3', 'Partner': 'Some Partner 3', 'J1': '', 'J2': '', 'J3': '', 'J4': '', 'J5': '' },         { 'CompetitionRoundEntryID': 4, 'NextRound': false, 'Competitor': 'Some Competitor 4', 'Partner': 'Some Partner 4', 'J1': '', 'J2': '', 'J3': '', 'J4': '', 'J5': '' },         { 'CompetitionRoundEntryID': 5, 'NextRound': false, 'Competitor': 'Some Competitor 5', 'Partner': 'Some Partner 5', 'J1': '', 'J2': '', 'J3': '', 'J4': '', 'J5': '' }     ];

Parents Reply Children