Announcement

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

    Duplicated value in Selectitem in TreeGrid

    Hi there,

    I'm trying to get SelectItems to work in the TreeGrid. Using the same logic like in a ListGrid seems to duplicate the selected value. In the example the selected value is represented and also the values from the valuemap. (Screenshot from Chrome)


    Tested with the latest nightly SmartClient_v100p_2015-04-13_Pro and i't's reproducable in chrome/firefox/IE.
    In IE (tested with IE 11.0.9600.17691) there seems also be a visual bug, whenswitching to edit-mode of the SelectItem the value of the SelectItem jumps few pixels down. Also there seems to be no need for the scrolling-bar in the picklist. See here:


    There seems to be no example for SelectItems in the TreeGrid, but it makes sense for working with same elements under a node.

    Edit:
    After selecting one of the other shown values, there are only 2 elements shown. Afterwards it is working correct. So it seems to be only a initialization issue?

    With this code you can reproduce this issue:
    Code:
    isc.TreeGrid.create({
    	"width" : "100%",
    	"height" : "100%",
    	"fields" :
    	[{
    			"name" : "reasonTreeGridField",
    			"title" : "Reason",
    			"type" : "text",
    			"canEdit" : true,
    			"editorProperties" : {
    				"ID" : "reasonTreeGridField_5Editor"
    			}
    		}, {
    			"name" : "fruitSelectItemTreeGridField",
    			"title" : "select fruit",
    			"canEdit" : true,
    			"editorType" : "SelectItem",
    			"valueMap" : {
    				1 : "banana",
    				2 : "peach"
    			}
    		}
    	],
    	"selectionProperty" : "isSelected",
    	"members" :
    	[],
    	data : isc.Tree.create({
    		"modelType" : "children",
    		"openProperty" : "isOpen",
    		"root" : {
    			"isOpen" : true,
    			"id" : "1",
    			"children" :
    			[{
    					"isFolder" : true,
    					"isOpen" : true,
    					"id" : "2",
    					"_canEdit" : false,
    					"reasonTreeGridField" : "theParentNode",
    					"fruitSelectItemTreeGridField" : "",
    					"children" :
    					[{
    							"isFolder" : false,
    							"isOpen" : false,
    							"id" : "3",
    							"_canEdit" : true,
    							"reasonTreeGridField" : "child",
    							"fruitSelectItemTreeGridField" : "peach"
    						}
    					]
    				}
    			]
    		}
    	})
    })
    Best regards
    Last edited by SimonF; 14 Apr 2015, 01:01.

    #2
    There doesn't seem to be any Framework bug here. You've specified ListGridField "fruitSelectItemTreeGridField" as a valueMap:

    Code:
    {
        "name" : "fruitSelectItemTreeGridField",
        "title" : "select fruit",
        "canEdit" : true,
        "editorType" : "SelectItem",
        "valueMap" : {
            1 : "banana",
            2 : "peach"
        }
    }
    but then in the data you defined the node in question with an invalid value for the "fruitSelectItemTreeGridField" field:

    Code:
    {
        "isFolder" : false,
        "isOpen" : false,
        "id" : "3",
        "_canEdit" : true,
        "reasonTreeGridField" : "child",
        "fruitSelectItemTreeGridField" : "peach"
    }
    The legal values according to the valueMap are 1 and 2; "peach" isn't allowed. If you want the initial display value to be "peach" you need to set the field value to be 2.

    Comment


      #3
      You're absolutely right, this was a wrong usage of the SelectItem, sorry for posting about this.

      The correct usage results into the given 2 values, but also seems to have that visual bug, that the value in the SelectItem jumps few pixels down if the edit mode is entered.
      Tested with the latest release (SmartClient_v100p_2015-04-16_Pro) and IE 11.0.9600.17691


      Code:
      isc.TreeGrid.create({
      	"width" : "100%",
      	"height" : "100%",
      	"fields" :
      	[{
      			"name" : "reasonTreeGridField",
      			"title" : "Reason",
      			"type" : "text",
      			"canEdit" : true,
      			"editorProperties" : {
      				"ID" : "reasonTreeGridField_5Editor"
      			}
      		}, {
      			"name" : "fruitSelectItemTreeGridField",
      			"title" : "select fruit",
      			"canEdit" : true,
      			"editorType" : "SelectItem",
      			"valueMap" : {
      				1 : "banana",
      				2 : "peach"
      			}
      		}
      	],
      	"selectionProperty" : "isSelected",
      	"members" :
      	[],
      	data : isc.Tree.create({
      		"modelType" : "children",
      		"openProperty" : "isOpen",
      		"root" : {
      			"isOpen" : true,
      			"id" : "1",
      			"children" :
      			[{
      					"isFolder" : true,
      					"isOpen" : true,
      					"id" : "2",
      					"_canEdit" : false,
      					"reasonTreeGridField" : "theParentNode",
      					"fruitSelectItemTreeGridField" : "2",
      					"children" :
      					[{
      							"isFolder" : false,
      							"isOpen" : false,
      							"id" : "3",
      							"_canEdit" : true,
      							"reasonTreeGridField" : "child",
      							"fruitSelectItemTreeGridField" : 1
      						}
      					]
      				}
      			]
      		}
      	})
      })
      Thanks & best regards

      Comment


        #4
        We're not able to reproduce the problem you describe using the specific build you mention and IE11, in either Windows 7 SP1 x64 or Windows 8.1 x64 (fully patched with the latest updates).

        Comment


          #5
          Trying to close this post finally.
          It was only a problem in the example. Html5 wasn't set in the example page.
          Code:
          <!DOCTYPE html>
          In our production this doesn't occur, so it is negligible.
          Thanks for the help

          Comment

          Working...
          X