Announcement

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

    ListGrid.alwaysShowEditors does not show custom editors

    Hi,

    I have tested with "Hands on demo" - "ISC_110_BRANCH_2017-04-06_1491488012_jenkins_node6/WWW Deployment" on Google Chrome.

    Setting editorType for a ListGridField to a custom class shows an editor only for current row in that field.

    Code:
    isc.defineClass("MyTextItem", "TextItem");
    
    isc.ListGrid.create({
        alwaysShowEditors: true,
    
        ID: "countryList",
        width:550, height:224, alternateRecordStyles:true,
        // use server-side dataSource so edits are retained across page transitions
        dataSource: countryDS,
        // display a subset of fields from the datasource
        fields:[
            {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
            {name:"countryName", editorType: isc.MyTextItem},
            {name:"continent"},
            {name:"member_g8"},
            {name:"population"},
            {name:"independence"}
        ],
        autoFetchData: true,
        canEdit: true,
        editEvent: "click"
    })
    If I set editorType to TextItem and add all the MyTextItem class properties through editorProperties, it works as expected.

    Best regards,
    Janusz

    #2
    Ok, I have read some code and I already know why that is happening, so I have other questions.
    I saw that only for some enumerated FormItems there is possibility to draw inactive versions and for all others (including their subclasses) there is only placeholder being drawn.
    I also saw that there is no possibility at the moment to have editors in all rows as active.

    What I want to achieve is to have a TextItem with two sets of icons - one set that is visible normally and another set visible only when the value has been changed but not yet saved: a SpinnerItem that hides plus/minus icons when you edit value manually and instead shows you save/cancel icons.
    On the first draw active and all inactive editors are being drawn with first set of icons. When I change value in active editor it starts to show second set of icons - then, when for some reason inactive editors are being redrawn, they are redrawn with second set of items.
    Any suggestion how to overcome this?

    Best regards,
    Janusz

    Comment


      #3
      We'd need a test case showing this behavior to understand how it could occur. However, first you should consider whether your current path makes sense:

      1. alwaysShowEditors in the ListGrid is somewhat constrained because it is designed to be able to show inactive editors for very large datasets. If you don't actually have a data volume problem, you might consider just a VStack of DynamicForms.

      2. alwaysShowEditors mode arguably goes against current design trends of having extremely simple screens with very few controls. So you might revisit why this mode is appealing and whether it makes sense for your application

      Comment

      Working...
      X