How to use wj-multi-select with List of string in wj-flex-grid-column in NG?

Posted by: miteshkumar.gohil on 24 February 2021, 6:24 am EST

  • Posted 24 February 2021, 6:24 am EST

    how to use wj-multi-select with List of string(not a list of the object) in wj-flex-grid-column in Angular 2+?

    I was trying but it is not working properly. checked items are not showing as checked like below here is how I was trying to

    do - https://stackblitz.com/edit/angular-v27ptd?file=app%2Fapp.component.html

    Thanks,

    Mitesh

  • Posted 24 February 2021, 6:27 am EST - Updated 3 October 2022, 2:15 pm EST

    here is the image of that issue

  • Posted 25 February 2021, 4:52 am EST

    Hi Mitesh,

    There seems to be an issue with MultiSelect and FlexGrid. Is it necessary to use the angular component of MultiSelect? If it is not, then I can update the CustomGridEditor class to accommodate MultiSelect also.

    Regards,

    Ashwin

  • Posted 1 March 2021, 3:37 am EST

    Hi Ashwin,

    yes, it is necessary to use Angular Multiselect. Actually, we are migrating all of our code from AngularJS to Angular and this wj-multi-select was working totally fine with a list of strings with the below implementation

     <wj-flex-grid-column header="{{ 'AdvisoryServUtil.TopicsAndSubtopics' | translate }}" align="left" word-wrap="true" required="false" binding="topicsAndSubtopics" width="4*">
                    <wj-flex-grid-cell-template cell-type="Cell">
                        <span ng-repeat="item in $item.topicsAndSubtopics">
                            <span class="label label-success">{{item}}</span>
                            {{ ($index === $item.topicsAndSubtopics.length -1 ) ? "" : " " }}
                        </span>
                    </wj-flex-grid-cell-template>
                    <wj-flex-grid-cell-template cell-type="CellEdit">
                        <wj-multi-select placeholder="Select Topics and Subtopics for Advisory Service"
                                         items-source="$ctrl.topicsAndSubtopics"
                                         header-format="{count} topics and subtopics selected"
                                         checked-items="$value">
                        </wj-multi-select>
                    </wj-flex-grid-cell-template>
                </wj-flex-grid-column>
    

    but when I try to use the same with Agular this issue started happening.

    So we required the same behavior what it was with AngularJS for wj-multi-select

    or else the 2nd option that you are suggesting using CustomGridEditor. so, will that work with a list of strings, or in that also I have to use the list of objects?

  • Posted 3 March 2021, 12:46 am EST

    Hi Mitesh,

    I apologize for the delay in response.

    The multiselect issue may be a bug because it does not exists in the latest version. So, if possible, you can upgrade Wijmo to the 5.20203.3766 version. In the latest version, we also have added a new editor property that can be directly used to add input controls as an editor for FlexGrid. So, multiselect will also work this.

    Regarding custom editors, I have updated the sample to use MultiSelect as a custom grid editor. It will work with both objects and strings.

    https://stackblitz.com/edit/angular-z6yf3q

    ~regards

  • Posted 3 March 2021, 9:00 am EST

    okay can you create a bug for it and give it here for tracking?

    and for upgrading Wijmo to the 5.20203.3766 actually, we are dependent on some common components which required a fixed version of wijmo currently it is 5.20202.732

    so will not able to update directly.

    and that custom editor demo you gave can I do those changes with 5.20202.732 version and achieve it?

    and if not then for now I did some workaround like while loading I am converting that list of string to objects and at the time of saving again converting back to list of strings

  • Posted 5 March 2021, 2:41 am EST

    Bugs are reported to the Dev team when they can be reproduced in the latest build , since this bug has been addressed in the build 5.20203.766 and can longer be reproduced in the latest build as well, therefore it does not meet the criteria of reporting this as a Bug.

    Regarding the Wijmo version, can you please confirm which version of Wijmo are you actually using? The sample which you provided uses the 5.20182.524 version which is different from the version according to your previous reply.

    Regarding custom editor, yes, these changes will work v732 but in v732, there is an editor property (which I described in my previous response), which can be easily used to add custom editors. You may refer to the sample link below which demonstrates how to use the editor:

    https://www.grapecity.com/wijmo/demos/Grid/Editing/CustomEditors/angular

    ~regards

  • Posted 17 March 2021, 6:18 am EST

    yeah the sample i gave in that i used demo example of multi select from wijmo site but the issue was same

    okay thank you Ashwin i will try your solution and let here know that works or not

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels