1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    bungrudi is on a distinguished road

      0  

    Question CellEditor and CheckBox doesn't get along, workaround?

    CellEditor and CheckBox doesn't get along, workaround?


    Hi,

    I have an EditorGrid that constructed like this.
    Basically it's a EditorGrid that have 2 columns, and have different editor field for each one.
    First column is a string column and have a TextField as the editor, and second column is a boolean and have a CheckBox as the editor.
    Now, the cells that have TextField behave as expected.
    However, those which have CheckBox as the editor do not.
    Clicking the cell will turn the cell into edit mode and showed the checkbox as expected, but clicking the checkbox will stop the editing and turn the cell back to view mode without toggling the boolean value.
    I believe the expected behavior should be for the checkbox to be clickable, toggling the boolean value in the process.
    A little debugging revealed that the click on the CheckBox is regarded as OnBlur, which I think should not be the case (please be aware of my minimum experience with GXT though).

    Is this a bug? Is there any workaround?

    Thanks before.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,634
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    The issue is probably due to the fact that CheckBox changes is value differently than most other fields. In most cases, the change event doesnt occur until blur, but in the case of a checkbox, often people want to have other changes happen in the UI as soon as the CheckBox changes, based on that change event.

    This feature can be disabled by calling CheckBox.setFireChangeEventOnSetValue(false). While I haven't tried your code sample, I believe this discrepancy between CheckBox and other Fields might be the root of your issue.

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    bungrudi is on a distinguished road

      0  

    Default


    Calling CheckBox.setFireChangeEventOnSetValue(false) didn't work.
    Do you have any other idea on what other thing we should try doing?

  4. #4
    Sencha User
    Join Date
    Sep 2009
    Posts
    11
    Vote Rating
    0
    abbnet is on a distinguished road

      0  

    Default


    Hi,

    Does anyone get a solution?

    I have the same need : an editorgrid with some columns. One column is render as a checkbox.
    The checkbox is only render when I click on the cell : it show the checkbox, so I can check or uncheck.
    It is possible to ovewrite the render to display the checkbox "image". But when I do this, when I click on the checkbox, it does not directly check/uncheck it, it displays the cell in edit view (so the real checkbox that I checkuncheck).

    What I would like to be possible : display the checkbox (checked or unchecked, depending of the value of the cell), and that the user can directly check/uncheck it. I would like a kind of "always display the edit mode view" for this column.
    Code:
    ColumnConfig checkboxCol = new ColumnConfig("Selection", "dataKeyOfCheckBox", 60);
    CheckBox cb = new CheckBox();
    cb.setInEditor(true);
    checkboxCol.setEditor(new CellEditor(cb));
    Note : I would like NOT to use a selection model, etc.

    Another general question : is it possible to display an editorgrid in a "edit view mode" always? I mean it does not switch automatically between read/write mode for each cell.

  5. #5
    Sencha User
    Join Date
    Sep 2009
    Posts
    11
    Vote Rating
    0
    abbnet is on a distinguished road

      0  

    Default


    Actually, it was quite simple. I used a CheckColumnConfig without CellEditor (not to have the cell switching to edit mode) + set the pluggin.

    Preview of some source code lines :

    Code:
    // ...
    CheckColumnConfig  checkboxColumn = new CheckColumnConfig("keyCol", "Title", 60);
    // ...
    ColumnModel cm = new ColumnModel(Arrays.asList(myCol1, myCol2, checkboxColumn));
    // ...
    grid.addPlugin(checkboxColumn);
    Then I customize some behaviour for my needs ( override getCheckState() and onMouseDown() ).

  6. #6
    Sencha User
    Join Date
    Feb 2014
    Posts
    1
    Vote Rating
    0
    scalin is on a distinguished road

      0  

    Default


    Quote Originally Posted by abbnet View Post
    Actually, it was quite simple. I used a CheckColumnConfig without CellEditor (not to have the cell switching to edit mode) + set the pluggin.

    Preview of some source code lines :

    Code:
    // ...
    CheckColumnConfig  checkboxColumn = new CheckColumnConfig("keyCol", "Title", 60);
    // ...
    ColumnModel cm = new ColumnModel(Arrays.asList(myCol1, myCol2, checkboxColumn));
    // ...
    grid.addPlugin(checkboxColumn);
    Then I customize some behaviour for my needs ( override getCheckState() and onMouseDown() ).
    Ok, but in this case the Grid events like beforeEdit, afterEdit, etc. will be not triggered anymore due to the fact that the cell does not become editable anymore.
    How can we ensure that the grid events will be triggered and also the checkbox will be checked from one single click?

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