Base solution for your next web application
Open Closed

combo box render Q #2844


User avatar
0
peterlee created

Hi~

i will make articleunitCombo.cshtml and js (permissionCombo.cshtml and js )

articleUnitService.getArticleUnits({}).then(function (result) {

                    angular.forEach(result.data.items,
                        function (item) {
                            <ins>**item.displayName = (Array(item.level+1).join("--")) + ' ' + item.displayName;**</ins>
                        });

                    $scope.articleunits = result.data.items;
                    //refresh combo
                    $timeout(function () {
                        $(element).selectpicker('refresh');
                    });
                });

item.level+1 code is error (+1)

My article unit has the same organizationalUnit and data table structure.

and

how to select box value set (articleunit.id)


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can directly use id property in articleunitCombo.cshtml. Does output dto for getArticleUnits contains a property named level ?

    Thanks.

  • User Avatar
    0
    peterlee created

    Ok..thanks..

    but,

    cshtml <articleunit-combo selected-articleunit="vm.requestParams.articleunit"></articleunit-combo>

    angular alert(vm.requestParams.articleunit);

    is null or empty

    how to get value or text?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can define your directive like this one <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Web/App/common/directives/roleCombo.cshtml">https://github.com/aspnetzero/aspnet-ze ... mbo.cshtml</a> <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Web/App/common/directives/roleCombo.js">https://github.com/aspnetzero/aspnet-ze ... leCombo.js</a>

    It is simple and easy to copy.

    Thanks.

  • User Avatar
    0
    peterlee created

    oops.....

    I already understand the directives and I have the source code as well.

    Despite understanding and writing code

    It does not get value or text value.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you send your project to <a href="mailto:[email protected]">[email protected]</a> ? It will be easier and faster to solve it in that way :).

    Thanks.