Announcement

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

    Grid field/column reorder with FilterEditor enabled

    I'm having issue with getting the drag and reorder of the fields on a grid. With the grid's FilterEditor enabled (setShowFilterEditor(true)), dragging the column header of a field to reorder the field for viewing purpose would only move the column header, not the data associated to the field. This causes the column header and its data out of sync. It's not happened all the time but only sometimes. And it seems to happen more often on a grid with many columns that required scrolling (maybe 10 or more columns). If the FilterEditor is disabled (setShowFilterEditor(false)) then there are no problems in dragging and reorder of the fields. How could I resolve this issue? Thanks.

    #2
    Please remember to always post the product and version you are using.

    What this sounds like is that some code is crashing so that reorder operation doesn't complete. It could be, for example, an event handler that you have added. Look in the SmartClient Developer Console for error information.

    Comment


      #3
      I'm using SmartGWT Enterprise Edition, version 6.1p. How do I find/access the SmartClient Developer Console?

      Comment


        #4
        Generally, you can just execute "javascript:isc.showLog()" in any page where SmartClient is loaded (including, for example, our own public Showcase). Further instructions are in the QuickStart Guide.

        Comment


          #5
          Again when dragging to reorder the fields on the grid with setting setShowFilterEditor(false) then there is no problem. But when setting setShowFilterEditor(true) then the field reordering cannot be completed like you mentioned. There are no extra events when Filter Editor is enabled. I've looked at the log from the SmartClient Developer Console but couldn't make sense from the log. Just wondering if you can spot anything from it? Thanks.

          09:14:46.321:XRP4:WARN:ListGrid:isc_LineItemGrid_0:ListGrid.setFields() : neither this ListGrid nor its dataSource have fields
          09:15:15.220:TMR7:WARN:Log:TypeError: Cannot read properties of null (reading 'dataPath')
          Stack from error.stack:
          FormItem.getCriteriaFieldName(<no args: exited>) on [TextItem ID:isc_TextItem_3 name:manageDocumentsIcon] @ ISC_Forms.js:1209:297
          [c]Class.invokeSuper(<no args: exited>) on [TextItem ID:isc_TextItem_3 name:manageDocumentsIcon] @ ISC_Core.js:298:93
          [c]Class.Super(<no args: exited>) on [TextItem ID:isc_TextItem_3 name:manageDocumentsIcon] @ ISC_Core.js:290:170
          TextItem.getCriteriaFieldName(<no args: exited>) on [TextItem ID:isc_TextItem_3 name:manageDocumentsIcon] @ ISC_Forms.js:1888:512
          FormItem.getCriterion(<no args: exited>) on [TextItem ID:isc_TextItem_3 name:manageDocumentsIcon] @ ISC_Forms.js:1223:391
          DynamicForm.removeItems(<no args: exited>) on [DynamicForm ID:isc_DynamicForm_5] @ ISC_Forms.js:294:402
          GridBody.redraw(<no args: exited>) on [FilterEditorBody ID:isc_IAppListGrid_1$31t_body] @ ISC_Grids.js:698:56
          [c]Canvas.clearRedrawQueue(<no args: exited>) on [Class Canvas] @ ISC_Core.js:3663:110
          [c]Class.fireCallback(_1=>Obj, _2=>null, _3=>null, _4=>null, _5=>true) on [Class Timer] @ ISC_Core.js:307:104
          Timer._fireTimeout(_1=>"$ir915", _2=>947, _3=>undef) on [Class Timer] @ ISC_Core.js:1774:166 null.<anonymous>() @ ISC_Core.js:1771:40

          Comment


            #6
            This looks similar to a stack trace from a long-since fixed bug, although it also looks similar to a usage issue that used to be able to lead to a crash like this, but is now caught earlier with a clear warning.

            1) if it's a usage issue, it could be a field name that has invalid characters (field names must be valid JavaScript identifiers)

            2) if it's a long-fixed bug, you just need to get the latest patched build for your version (see smartclient.com/builds)

            If neither of these help, we'll need some way to reproduce the claimed issue.

            Note we have both manual and automated tests that cover this use case, many times over, multiple times a day. Even so, we redundantly checked when you first raised this issue.

            Also just a future note, the full version is what we need who file an issue.

            Also, checking the Developer Console for crashes is really needed when reporting an issue, otherwise you could send us off in a wrong direction, thinking you got such behavior but nothing had crashed.

            Finally, note that even if you don't keep the Developer Console open all the time (which is strongly recommended), things like warnings and errors also appear in the browser's built-in developer tools, and in your GWT Eclipse console. So at a minimum please keep an eye on that, and then get the more complete information from the Developer Console if you have an issue you need to report.

            Comment


              #7
              One more (much more obscure) possible usage issue here: using a live FormItem instance as editorProperties - editorProperties needs to be just a JavaScript Object, not a live instance from some other already-created form.

              Comment


                #8
                Is there an event/handler to capture the grid column drag and reorder? I tried the grid's addFieldStateChangedHandler() but that doesn't seem to capture the event.

                Comment


                  #9
                  That’s exactly what does it. If it’s not firing for you, we’ll need to see a test case (as we already have both automated and manual tests).

                  Comment

                  Working...
                  X