Announcement

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

    problem with custom inline control

    SmartClient Version: SNAPSHOT_v13.1d_2024-07-09/AllModules Development Only (built 2024-07-09)

    Hello, I just noticed that if I configure a custom inline control for a SelectItem like this:

    Code:
    isc.DynamicForm.create({
        ID: "testForm",
        width: 400,
        fields: [
            {
                name: "multipleSelect", title: "Select items", editorType: "SelectItem",
                optionDataSource: "supplyItem",
                optionCriteria: {units:"Ream"},
                displayField: "itemName", valueField: "itemID",
                multiple: true,
                pickListProperties: {
                    gridComponents: [
                        isc.ToolStrip.create({
                            height:30,autoDraw:false,
                            width: "100%",
                            members: [
                                isc.ToolStripButton.create({
                                    width:"100%",
                                    icon: "[SKIN]/actions/approve.png",
                                    title: "Check All",
                                    click:function() {
                                        var item = testForm.getField("multipleSelect"),
                                            fullData = item.pickList.data,
                                            cache = fullData.localData,
                                            values = [];
    
                                        for (var i = 0; i < cache.length; i++) {
                                            values[i] = cache[i]["itemID"];
                                        }
                                        item.setValue(values);
                                    }
                                })
                            ]
                        }),
                        "body"
                    ]
                }
            }
        ]
    });
    when I open it, the ToolStripButton is correctly at width 100%:

    Click image for larger version

Name:	2024-07-10 10.07.20.jpg
Views:	64
Size:	28.9 KB
ID:	272859

    but after clicking "Check All", it shrinks like this:

    Click image for larger version

Name:	2024-07-10 10.08.07.jpg
Views:	49
Size:	27.7 KB
ID:	272860

    is it a bug, or am I missing something?

    #2
    hi Claudio,

    It does look like there might be a framework issue here, where perhaps a grid with no fixed width overflows to fit data may not notify custom members of the resize. We'll take a look.

    In the meantime, one workaround would be to apply a fixed pickListWidth. Also, if all you want to do here is select all the items, you can just call item.pickList.selectAllRecords() - that way you don't call setValue() and cause a pickList hide/show, so you won't get the button resize.

    Comment


      #3
      Ah, a quick follow-up - selectAllRecords() does select all the records in the pickList, but doesn't apply them to the item.

      Leave it with us, we'll take a look at both and get back to you.

      Comment


        #4
        Hello, any news about this issue? At least that about selectAllRecords() which in fact solves also the button resize problem.

        Comment

        Working...
        X