Categories | Question details Back To List | ||
dhxCalendar excell not working correclty after changing column type Hello! I have few problems with "dhxCalendar" type of excell. Also I have custom date format for this cell. 1. I need to have it in "ro" mode and "edit" mode, I have tryed few different approaches: 1.1 changing column type to "ro" and "dhxCalendar" 1.2 adding onRowDblClick event and there handle editor/viewer mode myself Both approaches have a problem. For 1.1 if I change colType from ro to "dhxCalendar", calendar behavior seems to be very strange. It opens but shows wrong date, but won't set new value from calendar. "setDateFormat" is setup correctly during grid initialization. If I reset "setDateFormat" after changing cellType, it shows correct date in calendar popup, but won't set any date from calendar. For 1.2 is kind of workaround problem in 1.1, but the same problem arise if I'm trying to change column type using setColTypes, while keeping dhxCalendar column unchanged. (like it were "dhxCalendar" and then being resetted to "dhxCalendar"). Only a way that leave it working is to set "dhxCalendar" type to column, after that load data and never change it. So I tryed to use "setColumnExcellType", to change exact columns, not touching "dhxCalendar" one, but I had just the same effect there. Anything else could be done to resolve this problem? Thanks! Answer posted by Support on Sep 09, 2008 08:05 >>For 1.1 if I change colType from ro to "dhxCalendar", calendar behavior seems to be very strange. The calendar stores additional data in comparation to ro column type, so switching between them dynamically is not safe. >>1. I need to have it in "ro" mode and "edit" mode, I have tryed few different approaches: grid.attachEvent("onEditCell",function(stage,id,index){ if (some_readonly_check(id,index)) return false; return true; }); with such code, each time when user will attempt to edit cell, the some_readonly_check function will be called, and based on its result the cell will be switched to edit state or preserved readonly ( returning false from onEditCell event block edit operation ) Answer posted by Nagh on Sep 09, 2008 08:11 Well, that ain't something I have expected, but might do the trick, thanks! Still one question left - why when changing exact column type, that ain't "dhxCalendar", calendar stop working correctly anyway, it shouldn't affect other cells, aint it? Answer posted by Support on Sep 09, 2008 10:13 >> if I'm trying to change column type using setColTypes The setColTypes changes the column type which will be used for new row creating, it not correct to use it to change existing cells. The grid supports grid.setCellExcellType( grid.setColumnExcellType(... grid.setRowExcellType(... which is legal way to change type of cells ( it will made correct type conversion , which must not corrupt data ) >>calendar stop working correctly anyway, it shouldn't affect other cells, aint it The usage of setCellExcellType must not affect any other cell except of target one. The second call of setCellTypes must not cause any side effects if column type wasn't changed. If issue still occurs for you - please provide any kind of sample where problem can be reconstructed ( you can send it directly to support@dhtmlx.com ) |