Announcement

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

    Bug in TreeGrid when reordering records inside the same folder

    Hello,

    In the sample below, when you try to move item_1 below item_3, it gets instead positioned between item_2 and item_3.
    Please note that this only happens when moving inside the same folder

    Code:
        isc.VLayout.create
        ({
            width:'100%',
            height:'100%',
            autoDraw:true,
            defaultLayoutAlign:'center',
            overflow:'auto',
            members:
            [
    			isc.TreeGrid.create
    			({
    				ID:'mytree',
    				alternateRecordStyles:true,
    				dataSource:isc.DataSource.create
    				({
    					ID:'supplyItem',
    					dataFormat:'json',
    					fields:
    					[
    						{name:"itemId", type:"integer", primaryKey:true},
    						{name:"parentId", type:"integer", foreignKey:"supplyItem.itemId", rootValue:0},
    						{name:'title', type:'text'}
    					],
    					clientOnly: true,
    					testData:
    					[
    						{itemId:1001,parentId:0,title:'folder_1'},
    						{itemId:1,parentId:1001,title:'item_1'},
    						{itemId:2,parentId:1001,title:'item_2'},
    						{itemId:3,parentId:1001,title:'item_3'},
    					]
    				}),
    				loadDataOnDemand: false,
    				canReorderRecords: true,
    				canReparentNodes: true,
    				canAcceptDroppedRecords: false,
    				canDragRecordsOut: false,
    				canEdit:true,
    				editByCell:true,
    				modalEditing:true,
    				showConnectors:true,
    				showFullConnectors:true,
    				canResizeFields:false,
    				canReorderFields:false,
    				canGroupBy:false,
    				canPickFields:false,
    				canFreezeFields:false,
    				canSort:false,
    				canAutoFitFields:false,
    				showHeaderContextMenu:false,
    				animateFolders:false,
    				fields:
    				[
    					{name:'title'}
    				],
    				dragDataAction: "move"
    		 	})
    		 ]
    	});
    	mytree.fetchData();
    This happens with latest LGPL build (2010-09-20)

    Greetings,
    Stéphane BARBARAY.

    #2
    Addendum : this problem happens only with an associated dataSource, so replacing it with :

    Code:
                    data: isc.Tree.create({
                        modelType: "parent",
                        nameProperty: "title",
                        idField: "itemId",
                        parentIdField: "parentId",
                        data: [
                            {itemId:1001,parentId:0,title:'folder 1'},
                            {itemId:1,parentId:1001,title:'item 1'},
                            {itemId:2,parentId:1001,title:'item 2'},
                            {itemId:3,parentId:1001,title:'item 3'},
                        ]
                    }),
    will work OK

    Greetings,
    SB

    Comment


      #3
      The problem has been encountered at least with FireFox and IE (page in quirks mode as recommended)

      Comment


        #4
        Hi,

        I am using Smart GWT 2.2 with GWT 2.0.3.

        I am seeing the same behavior in IE. Has this issue been resolved? or is there a workaround to solve this issue?

        Also running the IE page in Quirks mode.

        Comment


          #5
          For other people's reference.

          As a workaround for this issue. I wrote a if condition to check if the user is attempting to drag event.getNodes() to the end of the tree (event.getIndex()). If so, then use event.cancel() to prevent the nodes from moving at all.

          I hope this helps.

          Comment

          Working...
          X