Announcement

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

    TreeGrid with a Select field with different lists at different levels and display the list in a specified order

    I am using SmartClient_v111p_2017-09-16_LGPL with IE11.

    My field specification:

    Code:
    { name: "TaskID", title: "Subsystem Tree", width: 260, canEdit: true, changed: "ProjectTree_Changed(this)",
    treeField: true, frozen: true, editorType: "select", getEditorValueMap: "ProjTasksByLevel(this)", valueMap: AllProjTasks() },
    
    { name: "DisplayOrder"    , title: "Internal Order" , width:  30, canEdit: false, hidden: true , cellAlign: "right"        },

    The valueMap list all possible values to cover the initial loading. When a user edits the field, getEditorValueMap only list the values allowed for the node level. Because I want the valueMap to be in a certain order, I prefix the TaskIDs with the DisplayOrder set to a fixed length. When the user makes a selection, the changed function for the TaskID field splits the compound ID to set the correct TaskID and DisplayOrder. I then try to sort the TreeGrid by the DisplayOrder. I am having trouble getting this to work. Is there a better way of handling this situation?


    #2
    You are probably better off using an optionDataSource to handle this. This makes your valueMap entries into full Records, so that you can sort on a separate property rather than trying to cram the sort order into the valueMap key. The fact that the valueMap is dynamic can be handled by changing the criteria passed to the optionDataSource. And the optionDataSource involved can be a clientOnly DataSource, or even a dataProtocol:"clientCustom" DataSource, so there won't be an extra server trips or issues like that.

    Comment

    Working...
    X