Announcement

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

    Wrong selectedRecords in TreeGrids

    Hi there,

    we encountered a major issue with selections in a treegrid. In the example below you can see how you can reproduce this issue. We currently using Smartclient Pro v9.1p_2014-05-13, but the currently used version in the link below has also this issue. It seems like to be fixed in SmartClient 10.

    If you have multiple Treenodes you can select them by clicking on the checkbox. This works as expected in the example if you click the last 4 persons. The size of the selectedRecords you can see by clicking the button. If you're clicking the checkbox of the first person, you will see, by clicking the button again, that this person is now selected in the selectedRecords of the TreeGrid.
    We could create a workaround for this, but the seletedRecords from smartclient should be trusted.

    I made a few changes in one of your examples. Please copy this code to this example
    http://www.smartclient.com/docs/9.1/...adingSelection
    Code:
    isc.TreeGrid.create({
    	ID : "employeeTree",
    	data : isc.Tree.create({
    		modelType : "parent",
    		nameProperty : "Name",
    		idField : "EmployeeId",
    		parentIdField : "ReportsTo",
    		data : [{
    				EmployeeId : "4",
    				ReportsTo : "1",
    				Name : "Charles Madigen",
    				enabled:false
    			}, {
    				EmployeeId : "188",
    				ReportsTo : "4",
    				Name : "Rogine Leger"
    			}, {
    				EmployeeId : "189",
    				ReportsTo : "4",
    				Name : "Gene Porter"
    			}, {
    				EmployeeId : "265",
    				ReportsTo : "189",
    				Name : "Olivier Doucet"
    			}, {
    				EmployeeId : "264",
    				ReportsTo : "189",
    				Name : "Cheryl Pearson"
    			}
    		]
    	}),
    
    	fixedRecordHeights : false,
    	selectionAppearance : 'checkbox',
    	alternateRecordStyles : true,
    	selectionType:  'multiple',
    	height : '100%',
    	width : '100%',
    	nodeIcon : "icons/16/person.png",
    	folderIcon : "icons/16/person.png",
    	showOpenIcons : false,
    	showDropIcons : false,
    	closedIconSuffix : "",
    	selectionAppearance : "checkbox"
    });
    
    employeeTree.getData().openAll();
    
    isc.Button.create({
    	name:'theButton',
    	label: "How many are marked?",
    	click: function(){
    		var selectedRecords = employeeTree.getSelectedRecords();
    		isc.warn("selected:"+ selectedRecords.length);
    	}}
    );
    Best Regards,
    Simon

    #2
    Please try the latest patched build - and always do so in order to check whether bugs are fixed. The online version you're using is even older than your build.

    Comment


      #3
      thanks its working with the latest build.

      Comment

      Working...
      X