Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    [bug] [fixed] Key "tab" is not work correctly w CanvasItem in ListGrid inline editing

    Previous post: http://forums.smartclient.com/forum/...inline-editing

    Hi, Isomorphic,

    I've just solved that puzzle with "tab" and canvas item in inline edit.

    Problem is that _applyUnmaskedTargets() do not include inline editing form in "mask._unmaskedTargets" so inline edit form is completely masked by a Window.
    This happening because inline form is created later and also do not have a direct relationship within any element on screen.

    fix is just append { parentElement: {listgrid}, visibility: 'hidden' } (this works because Canvas.init do have a logic if has a property then "parentElement.addChild(this);")

    Maybe it's not a proper fix, but should be ok for proof of concept :)


    Demo:
    Code:
        isc.Window.create({
            width: 1200, height: 910, autoCenter: true,
            isModal: true,
            items: [
                isc.ListGrid.create({
                    ID: 'listGridDemo',
    
    // --- without this fix, "tab' do not works properly.
                    editFormProperties: {
                        parentElement: 'listGridDemo',
                        visibility: 'hidden'
                    },
    
                    autoDraw: false,
                    canEdit: true,
                    width: "100%",
                    fields: [{name: 'a'},
                        {
                            name: 'b',
                            editorType: "CanvasItem",
                            editorProperties: {
                                createCanvas: function () {
                                    return isc.DynamicForm.create({
                                        autoDraw: false,
                                        items: [{name:'item1', showTitle: false},
                                            {name:'item2', showTitle: false}]
                                    });
                                }
                            }
                        },
                        {name: 'c'}],
                    data: [{}]
                })
            ]
        });

    Technical notes:

    problem is in: isc.DynamicForm.addMethods._focusInNextTabElement(), ISC_Forms.js:13163
    Code:
    _focusInNextTabElement : function (forward, mask, skipItems, item) {
        if (skipItems || !this.items || this.items.length == 0 ||
            (mask && isc.EH.targetIsMasked(this, mask)))  // isc.EH.targetIsMasked(this, mask) <- returns true, because inline form is completely masked by Window
        {
            this.logInfo("DynamicForm - focusInNextTabElement() running. Delegating to Super()",
                         "syntheticTabIndex");
            return this.Super("_focusInNextTabElement", arguments);
        }
       //... focus in next tab logic ..

    Tested on: SmartClient_v100p_2015-12-11_LGPL
    browsers: all


Working...
X