Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34

Thread: [OPEN-575] roweditor: column-drag-drop, resize problems

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #11
    Sencha User
    Join Date
    Apr 2010
    Posts
    100

    Default

    Unfortunately this fix didn't work for me, I have modified RowEditor have form layout (i.e. when I doubleclick on a row, a small box with form and fields with labels appear) and this code didn't change anything.

    But thanks for the idea, I'll investigate in that direction!
    I feel that it is connected to the fact that something is definitely done only once at render and isn't done on re-layout, but just couldn't figure out what to grab to...

  2. #12
    Ext User
    Join Date
    Feb 2010
    Location
    Klaip?da
    Posts
    16

    Default

    I've updated the code in my previous post, maybe it'll work now.

  3. #13
    Ext User
    Join Date
    Apr 2010
    Location
    Russian Federation
    Posts
    9

    Default

    I made an event-method columnMove. It replaces items without removing.
    Code:
        columnMove: function(oldIndex, newIndex) {
            if (this.initialized) {
                this.stopEditing(false);
                var cm = this.grid.getColumnModel(), pm = Ext.layout.ContainerLayout.prototype.parseMargins;
                for(var i = 0, len = cm.getColumnCount(); i < len; i++){
                    var c = cm.getColumnAt(i),
                        ed = c.getEditor();
                    if(!ed){
                        ed = c.displayEditor || new Ext.form.DisplayField();
                    }
                    ed.column = c;
                    if(i == 0){
                        ed.margins = pm('0 1 2 1');
                    } else if(i == len - 1){
                        ed.margins = pm('0 1 2 1');
                    } else{
                        ed.margins = pm('0 1 2');
                    }
                    if(ed.ownerCt !== this){
                        ed.on('focus', this.ensureVisible, this);
                        ed.on('specialkey', this.onKey, this);
                    }
                    this.items.items[i] = ed;
                }
                this.verifyLayout(true);
            }
        },
    But, when RowEditor is in editing mode, some items are render wrong. After grid refreshing, it's looking good.
    When RowEditor is not in editing mode, all works good.
    There is a full version of modified script in attachment.

  4. #14
    Ext User
    Join Date
    Apr 2010
    Location
    Russian Federation
    Posts
    9

    Default

    Quote Originally Posted by dead_man View Post
    But, when RowEditor is in editing mode, some items are render wrong. After grid refreshing, it's looking good.
    I fixed this bug already. I replace in stopEditing method string
    Code:
    if(saveChanges === false || !this.isValid()){
    on
    Code:
    if(!saveChanges || saveChanges === false ||  !this.isValid()){
    Attached Files Attached Files

  5. #15
    Sencha User
    Join Date
    Apr 2010
    Posts
    100

    Default

    mdmitry, sorry but your code still doesn't fix the issue in my case.

    dead_man, thanks, your solution works like charm! But I don't get the trick - what makes is behave properly? Your event code is almost the same as initFields() that is called by refreshFields() method but instead of removing and re-inserting items
    Code:
    this.removeAll(false);
    ...
    this.insert(i, ed);
    you just do
    Code:
    this.items.items[i] = ed;
    Just wanted to make a little suggestment: I think you don't need these lines here:
    Code:
    if(!ed){
        ed = c.displayEditor || new Ext.form.DisplayField();
    }
    Because at that moment all the editors have already been created by initFields() on first show.


    Here is my modified version of your columnMove(), maybe it will be useful for someone:
    Code:
    columnMove: function(oldIndex, newIndex) {
            if (this.initialized) {
                this.stopEditing(false);
                var cm = this.grid.getColumnModel(), pm = Ext.layout.ContainerLayout.prototype.parseMargins;
                for(var i = 0, len = cm.getColumnCount(); i < len; i++){
                    var c = cm.getColumnAt(i),
                        ed = c.getEditor();
                    var dindex = cm.getDataIndex(i);
                    if(!Ext.isEmpty(dindex) && !this.in_array(dindex, this.hideIndexes) && ed) {                                         
                        ed.column = c;
                        if(i == 0){
                            ed.margins = pm('0 1 2 1');
                        } else if(i == len - 1){
                            ed.margins = pm('0 0 2 1');
                        } else{
                            ed.margins = pm('0 1 2');
                        }
                        if(ed.ownerCt !== this){
                            ed.on('focus', this.ensureVisible, this);
                            ed.on('specialkey', this.onKey, this);
                        }
                        this.items.items[i] = ed;
                    }
                    else
                        this.items.items[i] = new Ext.form.Hidden();    // just to keep proper indexes
                }
                this.verifyLayout(true);
            }
        }
    A few comments on that. In my column model I got several columns that I do not want to display and/or edit (these may be hidden columns for custom grouping, display-only columns that display a conjunction of several real Store fields etc.) so this is why I perform this check:
    Code:
    if(!Ext.isEmpty(dindex) && !this.in_array(dindex, this.hideIndexes) && ed)
    But to keep proper accordance between ColumnModel column indexes and editor form fields indexes I insert Hidden form fields for non-editable columns. There may be no editor assigned such column so there is ' && ed' clause at the end of the if statement given above. hideIndexes is just an array of strings representing underlying Store indexes I do not want to show, I added this parameter to RowEditor config. in_array() is just a simple function that checks if a given item exists in an array. It works like the one in PHP.


    I also wonder why the fields on my row editor form aren't really reordered after this code is executed. I do not need this behaviour though, but I wanted to figure out how it works.

    Thanks again for the solution!

  6. #16
    Ext User
    Join Date
    Feb 2010
    Location
    Klaip?da
    Posts
    16

    Default

    I've made a list of things RowEditor doesn't support:

    * moving columns while editing
    * moving columns while not editing, if there are editors that need wrapping (like checkbox)
    * resizing columns
    * changing grid ColumnModel dynamically with reconfigure()
    * expanding/collapsing groups, when using GroupingView

    The first three can be seen in official example.

    Guess I'll have to ditch this fubar component and somehow use EditorGridPanel instead.

  7. #17
    Sencha User
    Join Date
    Apr 2010
    Posts
    100

    Default

    * moving columns while not editing, if there are editors that need wrapping (like checkbox)
    I didn't understand, what do you mean by that?

    * resizing columns
    My version of RowEditor with layout: form reacts perfectly on column resize, even if RowEditor is active.

    * expanding/collapsing groups, when using GroupingView
    A use GroupingView with RowEditor and don't seem to have problems with it. What does go wrong in your case?

  8. #18
    Sencha User
    Join Date
    Aug 2009
    Posts
    20

    Exclamation roweditor inside windows cause also trouble

    There's already a big diff between dead_man & svn version.

    With dead_man patch, resize are working, but in the two version : if you put the RowGridEditor inside a window and you resize the window, and after that you close the window, reopen it you finish with an error.

    ( Try to use a Editor Grid inside the demo desktop in place of standard grid to have the demo)

    Tested with 3.2.1 & svn version

  9. #19
    Ext User
    Join Date
    Feb 2010
    Location
    Klaip?da
    Posts
    16

    Default

    Quote Originally Posted by mdmitry View Post
    * moving columns while not editing, if there are editors that need wrapping (like checkbox)
    1. open official example
    2. start editing a row
    3. click Cancel
    4. move "Active" column somewhere
    5. start editing a row again

    1.png

    this only happens with editors that have a wrapping DIV around them (like checkboxes or date/time editors)

    Quote Originally Posted by mdmitry View Post
    * resizing columns
    1. open official example
    2. start editing a row
    3. resize any column

    2.png

    Quote Originally Posted by mdmitry View Post
    * expanding/collapsing groups, when using GroupingView
    RowEditor doesn't react to expanding/collapsing groups. IMO if a group that contains current row is collapsed, editor should cancel editing (row hides -> editor hides), and if a group above is expanded/collapsed, roweditor should move with the row, not just stay on its current position. I guess this can be fixed externally using events, but it would be much better if it was supported out-of-the-box.

  10. #20
    Sencha User
    Join Date
    Apr 2010
    Posts
    100

    Default

    RowEditor doesn't react to expanding/collapsing groups. IMO if a group that contains current row is collapsed, editor should cancel editing (row hides -> editor hides), and if a group above is expanded/collapsed, roweditor should move with the row, not just stay on its current position. I guess this can be fixed externally using events, but it would be much better if it was supported out-of-the-box.
    Ok I got your point. Since my editor isn't 'attached' to the row, this behaviour is normal for me.

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •