#action column not showing any items when another column is shown based on a trigger

16 messages · Page 1 of 1 (latest)

slender lily
#

I have a column named as Expense Reserve, I am showing that column based on a flag. when that flag is true the expense reserve column is shown. but the items inside the options column are not shown. Kindly help

iron chasm
#

Have you bound your data to that column? Would be nice to see some code

slender lily
#
<ejs-grid #reservesGrid [dataSource]="gridDS" [allowKeyboard]="false" [allowSorting]='true' [allowSelection]='false'
        allowTextWrap='true' [allowPaging]='true' [enableHover]="false" (mouseover)="tooltipValue($event)"
        [pageSettings]="{pageSize: 10, pagesSizes : true}" [toolbar]="grid_ToolbarOptions"
        (toolbarClick)="grid_ToolbarClick($event)" (created)="grid_onCreated()">
        <e-columns>

            <e-column field='reservesKey' headerText='reservesKey' isPrimaryKey="true" [visible]="false"></e-column>
            <e-column field='claimUnit' headerText='Unit' width=60></e-column>
            <e-column field='partyNumber' headerText='Party' width=80>
                <ng-template #template let-data>
                    {{ data.partyNumber + ' - ' + data.partyName }}
                </ng-template>
            </e-column>
            <e-column field='coverageDescription' headerText='Coverage' width=140></e-column>
            <e-column field='lossCauseDescription' headerText='Loss Cause' width=100></e-column>
            <e-column field='lossReserve' headerText='Loss Reserves' width=90 format="C2"></e-column>
            <e-column field='expenseReserve' headerText='Expense Reserves' width=90 *ngIf="showExpenseReserves"
                format="C2"></e-column>
            <e-column field='adjusterName' headerText='Adjuster' width=90></e-column>
            <e-column headerText='Options' width=80>
                <ng-template #template let-data>
                    <edit-icon [can]="permissions.canEdit"
                        (OnIconClick)="ShowEditModal.bind(this,data)($event)"></edit-icon>

                    <x-icon icon-class="fa fa-usd" (OnIconClick)="ShowPaymentsModal.bind(this,data)($event)"
                        iTitle="Create Financial"></x-icon>

                </ng-template>
            </e-column>
            

        </e-columns>
    </ejs-grid>
#

one is where the flag is true and one is where it is false

iron chasm
#

and the typescript? What's the value of gridDS?

slender lily
#
LoadReserves() {
    this.rc.getReserves( this.context.claim )
      .subscribe(reserves => {
        this.gridDS = new DataManager(reserves);
        for(var item of reserves){
          this.groupIds.add(item.claimUnit?.toString());
          this.groupsPartyNumber.add(item.partyNumber?.toString());
          this.groupsCoverageCode.add(item.coverageCode?.toUpperCase());
        }
      })
  }
#

gridDS is the data source

#
 getCompanyInstalled()
  {
    this.gc.getDetails('Company_installation_test').subscribe(res =>{
      console.log(res);
      if(res)
      {
        if(res[0].code == "IH" &&
        res[0].description == "Insurance house" && res[0].isCodeValid == "1")
        {
          this.showExpenseReserves = true;
        }
        else {
          this.showExpenseReserves = false;
        }
      }
    })
  }
#

this is the condition for the column to be shown or not

#

Help

iron chasm
#

I'm not sure why your buttons are disappearing. Looks like because it only gets data for X columns that it doens't know what to fill into the last one, even thought it should just show a column with buttons

slender lily
#

in normal senario we do get the buttons visible. But since I have added that ngIf condition on expense reserve column it is not rendering the column when the condition is true

stark gale
#

So if u drop the ngIf, it works ?

slender lily
stark gale
#

Not all code of ejs is opensource, so I can't realy look at it.

#

So not sure if they have an issue with using ngIf or not.