Announcement

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

    Buttons are not loaded in list grid, when we do refersh

    Hi,

    We are using Smart Gwt-4.1p (23rd May 2014)
    Browser: IE10, 11, Google Chrome:37.0.2062.124 m

    Issue : Buttons are not loaded in list grid, when record is more than 30.
    First time button is loaded properly.
    Steps:
    1. Expand column width so that will get horizontal scroll and last 3 button columns should display on scroll.
    2. Click on refresh button

    All the button is not loaded and user is not able to scroll till last width. Horizontal Scroll is coming back to beginning and button object is getting created on horizontal scroll.
    Finally button is not displaying in list grid.

    PFA files.
    Thanks...
    Attached Files
    Last edited by vnathank; 23 Jan 2015, 02:59.

    #2
    You've posted a large amount of application code here, any part of which might have usage issues that create this problem.

    If you believe the issue you're seeing is due to a framework bug, post a minimal test case demonstrating the issue.

    Advice for creating a minimal test case can be found in the Debugging topic.

    Comment


      #3
      Buttons are not loaded in list grid, when record is more than 30.

      Hi,

      I have modified the code in one file. Please find the attached code.

      Please let me know for any query.

      Thanks.
      Attached Files

      Comment


        #4
        Ok - we're taking a look and will update here when we have more information.

        Comment


          #5
          There are various problems with this code.

          1) There are DSFields of type "datetime" that do not contain datetime values - there's a transformResponse() implementation that, at best, sets these values to date-type strings, and at worst sets them to "-". Neither of these is a datetime. You should be seeing a great many logs, as we do, that the isDate validator is failing with all of these values. You probably want a string-based field in the DS, with a ListGridField that uses a cell formatter to check for null and formats that value to "-", rather than a datasource-level transformation. You didn't include the class you're using to deal with timezone conversion either, so we're not really sure what that is expected to return.

          2) You are wrapping each and every recordComponent in it's own HLayout - this means that, at best, createRecordComponents() is creating twice the number of recordComponents it needs (which is already 6 or so per record, a LOT of recordComponents).

          3) In fact, it's worse than that, because your createRecordComponents() implementation *always* creates and returns an HLayout (there is a "return recordCanvas;" statement after all of your conditionals). So, at least an HLayout is being created for every single cell in the grid, every time createRecordComponents() runs. You should *not* create an HLayout for fields that don't need a recordComponent, and you should return null.

          4) You should use a ListGridField of type "image" to display your delete icon, or just ListGrid.setCanRemoveRecords(true), which will show this column for you.

          5) Your recordComponents are all of fixed width - when components sit in cells, they should be width: "100%" - at least the outer HLayout, in your case. This is almost certainly the reason for your actual complaint, here, although we aren't able to see it happening, because the inefficiency of the rest of the code makes it impossible to test your sample.

          Our advice is that you address these issues above and then let us know if you still have questions - at that time, we'll want to see the code again.
          Last edited by Isomorphic; 30 Jan 2015, 05:06.

          Comment


            #6
            Hi Isomorphic,

            Thanks for reviewing our code and according to your suggestion we modified the code, but still the issue is observed.

            Please find the attachment of updated files and we also attached the screen shot for your reference.

            To reproduce the issue steps are same, which we already provided in the firstPost.
            Please let us know for any query.

            Thanks.
            Attached Files

            Comment


              #7
              Hi,

              Can you please update the status of above issue?

              Thanks.

              Comment


                #8
                We still don't see the effect you show in your screenshot, and we don't see any issues with not being able to scroll all the way to the right either.

                Can you clarify which of the issues you reported you are still seeing, now that you changed your code?

                From your description, it sounds like fields which are not in the visible viewport are not having recordComponents created for them - we don't any problems here, but that should be happening when the fields are scrolled into view, so we can take a look into that, if that's what issue you're having.

                Comment


                  #9
                  Buttons are not loaded in list grid.

                  Yes- you are right, fields which are not in the visible viewport are not having recordComponents created for them . This is happening when the fields are scrolled into view.

                  2nd Feb 2015, 04:53 we have modified the code according to your post 30th Jan 2015, 06:00.
                  Our modified code is attached in 2nd Feb 2015, 04:53 post.


                  I have attached screen shot for your reference.

                  Please let us know for any query.
                  Attached Files
                  Last edited by vnathank; 11 Feb 2015, 02:24. Reason: Already provided the description.

                  Comment


                    #10
                    Ok, we're finally able to reproduce this - we're looking at it now.

                    Comment


                      #11
                      Can you try just removing the call to scrollToRow(0) and see if that fixes things for you?

                      It doesn't really make sense to call scrollToRow() at that point, immediately after calling invalidateCache(), which clears out data, and that's likely to be causing issues - let us know if making that change fixes your problem and we can instead look at what effect you wanted from scrollToRow().

                      Comment


                        #12
                        Thanks for your reply.
                        If i remove scrollToRow(0) it is working fine but we need scrollToRow(0) .
                        Once we do refresh we are moving listgrid scroll to the beginning.
                        Is there any alternative for scrollToRow(0)?

                        Comment


                          #13
                          We would expect scrollToRow() to work if you call if when the data is actually available, rather than when it has just been invalidated - try calling it from dataArrived().

                          Comment


                            #14
                            If i try to calling it from dataArrived() i am getting same issue.

                            I modified the code according to your above post and attached for your reference.

                            Thanks.
                            Attached Files

                            Comment


                              #15
                              If you setShowAllColumns(true) on your ListGrid subclass, this will ensure that all columns are drawn, and thus their components created. It shouldn't then matter when you scrollToRow(0), although it should either be before you invalidate the cache, or after data arrives.

                              Comment

                              Working...
                              X