Announcement

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

    Too much recursion?

    Smartclient 7.0rc2

    Depends on the browser as to the error reported, but using FF it says 'too much recursion' in ISC_DataBinding.js Line 73

    To re-create the error, right-click on any of the columns in the upper listgrid and 'group by', then expand a row and drag it to the lower listgrid et voila.

    Dragging the row without grouping works perfectly to and from either listgrid.

    Each ListGrids is bound to a clientOnly DataSource because of a design constraint.

    Code:
    isc.setAutoDraw(false);
    
    countryData = [
    {
        continent:"North America",
        countryName:"United States",
        countryCode:"US",
        area:9631420,
        population:298444215,
        gdp:12360.0,
        independence:new Date(1776,6,4),
        government:"federal republic",
        government_desc:2,
        capital:"Washington, DC",
        member_g8:true,
        article:"http://en.wikipedia.org/wiki/United_states"
    },
    {
        continent:"Asia",
        countryName:"China",
        countryCode:"CH",
        area:9596960,
        population:1313973713,
        gdp:8859.0,
        government:"Communist state",
        government_desc:0,
        capital:"Beijing",
        member_g8:false,
        article:"http://en.wikipedia.org/wiki/China"
    },
    {
        continent:"Asia",
        countryName:"Japan",
        countryCode:"JA",
        area:377835,
        population:127463611,
        gdp:4018.0,
        government:"constitutional monarchy with parliamentary government",
        government_desc:1,
        capital:"Tokyo",
        member_g8:true,
        article:"http://en.wikipedia.org/wiki/Japan"
    }
    ]
    
    isc.DataSource.create({
        ID: "countryDS",
        fields:[
            {name:"countryCode", title:"Code",primaryKey:true},
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital"}
        ],
        clientOnly: true,
        testData: countryData
    })
    
    isc.DataSource.create({
        ID: "outDS",
        fields:[
            {name:"countryCode", title:"Code",primaryKey:true},
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital"}
        ],
        clientOnly: true
    })
    
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
        dataSource: countryDS,
        autoFetchData: true,
    	    canDragRecordsOut: true,
    			canEdit:false,
    	    canAcceptDroppedRecords: true,
    			showAllRecords:true,
    	    dragDataAction: "move"
    
    })
    
    isc.ListGrid.create({
        ID: "countryOutList",
        width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
        dataSource: outDS,
        autoFetchData: true,
    	    canDragRecordsOut: true,
    			canEdit:false,
    	    canAcceptDroppedRecords: true,
    			showAllRecords:true,
    	    dragDataAction: "move"
    
    })
    
    isc.VLayout.create({
        members:[
            countryList,
    				countryOutList
        ],
       ID:"mainLayout",
    		width:"70%",
    		height:525,
    		position: "relative",
       autoDraw: true
    })
    Without the local datasources, there is no problem with grouped dragging from one listgrid to the other:

    Code:
    isc.setAutoDraw(false);
    
    countryData = [
    {
        continent:"North America",
        countryName:"United States",
        countryCode:"US",
        area:9631420,
        population:298444215,
        gdp:12360.0,
        independence:new Date(1776,6,4),
        government:"federal republic",
        government_desc:2,
        capital:"Washington, DC",
        member_g8:true,
        article:"http://en.wikipedia.org/wiki/United_states"
    },
    {
        continent:"Asia",
        countryName:"China",
        countryCode:"CH",
        area:9596960,
        population:1313973713,
        gdp:8859.0,
        government:"Communist state",
        government_desc:0,
        capital:"Beijing",
        member_g8:false,
        article:"http://en.wikipedia.org/wiki/China"
    },
    {
        continent:"Asia",
        countryName:"Japan",
        countryCode:"JA",
        area:377835,
        population:127463611,
        gdp:4018.0,
        government:"constitutional monarchy with parliamentary government",
        government_desc:1,
        capital:"Tokyo",
        member_g8:true,
        article:"http://en.wikipedia.org/wiki/Japan"
    }
    ]
    
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
        fields:[
            {name:"countryCode", title:"Code",primaryKey:true},
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital"}
        ],
    		data:countryData,
    	    canDragRecordsOut: true,
    			canEdit:false,
    	    canAcceptDroppedRecords: true,
    			showAllRecords:true,
    	    dragDataAction: "move"
    
    })
    
    isc.ListGrid.create({
        ID: "countryOutList",
        width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
        fields:[
            {name:"countryCode", title:"Code",primaryKey:true},
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital"}
        ],
        canDragRecordsOut: true,
    		canEdit:false,
        canAcceptDroppedRecords: true,
    		showAllRecords:true,
        dragDataAction: "move"
    
    })
    
    isc.VLayout.create({
        members:[
            countryList,
    				countryOutList
        ],
       ID:"mainLayout",
    		width:"70%",
    		height:525,
    		position: "relative",
       autoDraw: true
    })

    #2
    As a further observation, using the second example of ListGrids without a localDatasource binding, when you do:

    Code:
    countryOutList.data
    If you have grouped the bottom ListGrid, you get a Tree returned whereas if you haven't grouped it, you get a simple array of record objects.

    Comment

    Working...
    X