Announcement

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

    [bug] ListGrid inline editing wont work with any CanvasItem subclass.

    Hi,
    I've noticed that if I use any CanvasItem for inline editing, it just goes crazy.

    demo:

    1) double click on empty row. (leave it as is, don't edit)
    2) click on "Others" tab.
    3) click on "Main" tab.
    4) focus on any input item and press ESCAPE key (cancel editing).
    5) click on "Others" tab.
    6) click on "Main" tab.

    whola, you've revealed a mystery


    Code:
        isc.TabSet.create({
            tabBarPosition: "top",
            width: 700,
            height: 300,
            tabs: [
                {
                    title: "Main",
                    pane: isc.ListGrid.create({
                        canEdit: true,
                        width: "100%",
                        fields: [
                            {name: 'a'},
                            {name: 'b',editorType: "DateRangeItem"},
                            {name: 'c',editorType: "MultiComboBoxItem"}],
                        data: [{}]
                    }),
                    name: "a"
                },
                {
                    title: "Others",
                    pane: this.VLayout.create({}),
                    name: "b"
                }
            ]
        });

    #2
    Neither of these items would be expected to work in an inline editor due to space requirements, although other CanvasItems do work for inline editing.

    As far as whatever you're seeing, even with a test case, we need a prose description of what it is, as well the product version and browser. There are a lot of reasons why we might not reproduce whatever you're seeing (eg, people sometimes post "bugs" that only happen on pre-release browsers, only on a particular OS, only with certain browser plugins installed, etc).

    Comment


      #3
      tested with: SmartClient/10.0p/LGPL/2015-12-05
      latest chrome, latest firefox, latest internet explorer. all not works.

      other CanvasItems? which one?

      All doesn't work, all which extends CanvasItem, then are not hidden properly, you can try it out with this snippet:

      Btw if CanvasItem is not intended to work on inline editing how could I implement my own component which would work inside inline editing?

      PS. It completely unrelated to space requirements you are talking about.
      Its in ListGrid.hideInlineEditor() which calls refreshCellValue() and which clears all inline edit html, and removes a spacer_parent element. But CanvasItem is still observing its parent and then it changes visibility it calls CanvasItem.
      it will trigger CanvasItem._containerWidgetVisibilityChanged() which calls placeCanvas() and then all CanvasItem's which was no longer visible on listgrid will be redrawn again.
      I think you should destroy ListGrid._editRowForm component when inline edit is finished or cancelled.

      It's actually a shame that I must point to your bugs in your framework and saying that it's a bug in your code. lol, better allow us to contribute to your framework over github instead of wasting our time on this forum.


      Code:
          isc.TabSet.create({
              tabBarPosition: "top",
              width: 1200,
              height: 300,
              tabs: [
                  {
                      title: "Main",
                      pane: isc.ListGrid.create({
                          canEdit: true,
                          width: "100%",
                          fields: [
                              {name: 'a'},
                              {name: 'b',editorType: "DateRangeItem"},
                              {name: 'c',editorType: "MultiComboBoxItem"},
                              {name: 'd',editorType: "FileItem"},
                              {name: 'e',editorType: "RelationItem"},
                              {name: 'f',editorType: "SliderItem"},
                              {name: 'g',editorType: "ValueMapItem"},
                              {name: 'h',editorType: "PickTreeItem"},
                              {name: 'l',editorType: "RelativeDateItem"}
                          ],
                          data: [{}]
                      }),
                      name: "a"
                  },
                  {
                      title: "Others",
                      pane: this.VLayout.create({}),
                      name: "b"
                  }
              ]
          });

      Comment


        #4
        Fixed by myself,

        Just add to your ListGrid.create, this code:
        Code:
                            visibilityChanged: function (visible) {
                                if (!visible) {
                                    this.setDataSource(this.getDataSource()); // this will trigger destroying of this._editRowForm object.
                                    this.fetchData();
                                }
                            }
        And it will fix everything.

        demo with fix:
        Code:
            var ds = isc.DataSource.create({
                clientOnly: true,
                fields: [{name:'a'},{name:'b'},{name:'c'}],
                testData: [{a:'',b:'',c:''}]
            });
        
            isc.TabSet.create({
                tabBarPosition: "top",
                width: 1200,
                height: 300,
                tabs: [
                    {
                        title: "Main",
                        pane: isc.ListGrid.create({
                            autoFetchData: true,
                            dataSource: ds,
                            canEdit: true,
                            width: "100%",
                            fields: [
                                {name: 'a'},
                                {name: 'b', editorType: "DateRangeItem"},
                                {name: 'c', editorType: "MultiComboBoxItem"},
                            ],
                            visibilityChanged: function (visible) {
                                if (!visible) {
                                    this.setDataSource(this.getDataSource());
                                    this.fetchData();
                                }
                            }
                        }),
                        name: "a"
                    },
                    {
                        title: "Others",
                        pane: this.VLayout.create({}),
                        name: "b"
                    }
                ]
            });
        Thanks for support.

        Comment


          #5
          Thanks for the version info and description of the problem.

          CanvasItems in general work for inline editing. It looks like you've found an obscure bug related to hide/show cycling in TabSet. The fact that you were using two CanvasItem classes that don't make sense for inline editing confused the issue.

          The fix is definitely not correct, but we'll apply a correct fix.

          If you end up contributing a correct fix or other change in the future, we can set you up a committer. It's not just a matter of a GitHub account, but instead, of being able to run our suite of automated tests on AWS and various other process / workflow setup.

          In the meantime, while someone else will be reviewing your changes and applying them, the important thing to keep things moving quickly is to remember to include key information like what the problem is, what product you are using, etc.

          Comment


            #6
            Finally you've heard me. Thank you. I'll try to describe a problem with more details in future, hope it helps better for communication.
            PS. Please inform me about which version will contain a fix for this issue.

            Comment


              #7
              We've now made a change to address this issue. The change will be in the next nightly build dated Dec 10 or above - both 10.0 and 10.1 branches.
              Please let us know if you continue to see the problem

              Regards
              Isomorphic Software

              Comment


                #8
                I can confirm that now everything is working properly. Thank you!

                Tested on SmartClient_v100p_2015-12-11_LGPL

                Comment

                Working...
                X