Announcement

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

    dragType for ListGrid/TreeNode

    I would like to implement dragType for ListGrid/TreeGrid but I cannot find any examples where records are being used. Is it possible? If so, where do I put the dragType property? For listgrid it is quite simple since there is only one type but for the TreeGrid, in our case, different nodes can have different dropTypes.

    In theory I would like to be able for listgrid to set dropType and dragType on the control itself. For TreeGrid, I would like to be able to set dropType and dragType as part of the tree data.

    If you don't support either out of box, how do I override the default implementation? willAcceptDrop does not seem to have any parameters according to the documentation. I want to be able to show the user where they can/cannot drop while the mouse is still down.

    #2
    No, there's no concept of setting dragType and dropType on a per-record (or TreeNode) basis.

    See the docs for willAcceptDrop - like the built-in method does, you can discover the dragTarget via EventHandler.getDragTarget(), and can take a look at the data it's dragging via getDragData().

    The target record for the drag is always available via getEventRow() (for TreeGrids, also look at getDropFolder()).

    Comment


      #3
      Will try those the. Thanks

      Comment


        #4
        Hi - I have a tile grid that I would like to perform a drop on and have willAcceptDrop called. Unfortunately when I try to drop a tile from another tilegrid, willAcceptDrop is not called. Is there something special about tilegrid that differentiates itself from listgrid? Works fine if the two grids are listgrid

        Comment


          #5
          Sorry just tried in a standalone and it works fine. I'll debug some more

          Comment


            #6
            I have figured out a way to get willAcceptDrop to work but now I get this exception:

            Code:
            10:52:47.746:MUP3:WARN:Log:TypeError: this.$60z is not a function
            Stack from error.stack:
                unnamed(isc_Canvas_transferRecord)
                unnamed(isc_TileGrid_dro)
                unnamed(isc_Canvas_handleDro)
                unnamed(isc_c_EventHandler_bubbleEven)
                unnamed(isc_c_EventHandler_handleEven)
                unnamed(isc_c_EventHandler_handleDragSto)
                unnamed(isc_c_EventHandler__handleMouseU)
                unnamed(isc_c_EventHandler_handleMouseU)
                unnamed(isc_c_EventHandler_dispatc)
                unnamed(anonymou)
                unnamed() @
            Would you be able to tell me what this stack is looking for? My listgrids handle onRecordDrop on their own - so adding/removing from the list is taken care of my our product code. I only get this error when using tile grid and I cannot reproduce it as a standalone.

            Comment


              #7
              any idea about this one?

              Comment


                #8
                Yes, this has been fixed for tomorrow's builds

                Comment


                  #9
                  sorry which build? I thought I mentioned I was using 8.3 but I guess that was in my other post. I tried 8.3-01-10-2014 and I still get the error

                  Comment


                    #10
                    9.0 and 9.1. Please don't do new development on 8.3 (this seems to be obviously new development..).

                    Comment


                      #11
                      Umm first of all, was drag and drop on tile grid available in 8.3? If yes, I would I assume it SHOULD work in 8.3.

                      Secondly, our drag and drop feature in our product was first implemented in 8.3. The tile grid was just an oversight and was recently found broken by one of our users.

                      Third, we cannot move to 9.0 as of yet as it has broken so many of our test cases

                      Comment


                        #12
                        bottom line for us is - we need to use tile grid drag and drop for our march release which is currently using SmartClient_v83p_2013-08-15_PowerEdition. Please port the changes to the 8.3 stream or provide a patch or tell me what further steps to take to get these changes. Thank you.

                        Comment


                          #13
                          Third, we cannot move to 9.0 as of yet as it has broken so many of our test cases
                          We have no open issues from you regarding Selenium support or other issues in 9.0, so presumably this refers to the usage issues we've discussed previously, or some kind of unreported issues.

                          We'd strongly recommend against shipping a current product on 8.3, which is over a year old and about to become two releases behind.

                          The problem is that Microsoft has started rapidly (for them) shipping new versions of IE and has turned on auto-update, and each new release has had a rash of serious bugs - much more serious than any other browser vendor. When these require pervasive, risky changes to work around, we will not be backporting the fixes, because it makes more sense for most customers to just move to a reasonably recent release if they want support for the latest IE (less risky and better positioned for the future).

                          As an example of the kind of issues in recent IE releases, we've already had to give up on stopping memory leaks for IE for any non-current SmartClient version, because really really basic operations leak memory, with no workaround.

                          So it is quite plausible that there will be an IE12 or IE13 issue that we will not fix for 8.3. It depends on how badly Microsoft does on their next couple of releases.

                          Now that you understand why we recommend what we do, let us know if you really want TileGrid<->ListGrid drag and drop patched for 8.3. It can be done of course, it's just something we consider a step in the wrong direction.

                          Comment


                            #14
                            Another issue I found - and this is also reproduceable in 9.1 - if I dynamically set canDragTilesOut, then the drag is not enabled. Only when I set it as part of the initialization does it work. Take a look at the sample. The button "test" will attempt to set the property to true.

                            Code:
                            isc.defineClass("PartsListGrid","TileGrid").addProperties({
                                width:150, cellHeight:24, imageSize:16,
                                showEdges:true, border:"0px", bodyStyleName:"normal",
                                alternateRecordStyles:true, showHeader:false, leaveScrollbarGap:false,
                                emptyMessage:"<br><br>Drag &amp; drop parts here",
                                fields:[
                                    {name:"partSrc", type:"image", width:24, imgDir:"pieces/16/"},
                                    {name:"partName"},
                                    {name:"partNum", width:20}
                                ],
                                trackerImage:{src:"pieces/24/cubes_all.png", width:24, height:24}
                            })
                            
                            
                            isc.HStack.create({membersMargin:10, height:160, members:[
                                isc.PartsListGrid.create({
                                    ID:"myList1", 
                                    data: exampleData,
                                    canDragRecordsOut: true,
                                    canReorderRecords: true,
                                    dragDataAction: "copy"
                                }),
                                isc.Img.create({src:"icons/32/arrow_right.png", width:32, height:32, layoutAlign:"center",
                                    click:"myList2.transferSelectedData(myList1)"
                                }),
                                isc.PartsListGrid.create({
                                    ID:"myList2",
                                    left:300,
                                    canAcceptDroppedRecords: true,
                                    canReorderRecords: true
                                })
                            ]})
                            
                            isc.Button.create({
                            top: 400, title: "test", click: function(){myList1.setProperty("canDragTilesOut", true); myList1.canDragTilesOut = true;}
                            
                            })

                            Comment


                              #15
                              Just to clarify, this is not a regression relative to some previous release right? We're fixing it, but it doesn't look like a new bug.

                              Comment

                              Working...
                              X