Need to either check pdf or excel

Posted by: bemes9226 on 5 February 2021, 11:52 am EST

  • Posted 5 February 2021, 11:52 am EST

    actually i having pdf,excel,html these three having check box.i want to one functionality as either need to check pdf or excel.we need check one value only.

    pdf excel this two like either check one value only.

    html check box is seperate functionlity.

    https://stackblitz.com/edit/js-grtjmz

  • Posted 8 February 2021, 8:48 am EST

    Hi,

    You may handle the cellEditEnded event to achieve the required functionality. Please refer to the following code snippet and the sample demonstrating the same and let us know if you face any issues:

    https://stackblitz.com/edit/js-avjc6w

    ~sharad

  • Posted 8 February 2021, 11:13 pm EST

    when i click checkbox i am getting this error

    ERROR TypeError: ‘ownKeys’ on proxy: trap returned duplicate entries

    flex.cellEditEnding.addHandler((s: wjcGrid.FlexGrid, e: wjcGrid.CellEditEndingEventArgs) => {

    debugger;

    let col = s.columns[e.col].binding;

    // update the original value

    // when the ratin start is clickced

    if (col === “Favorite”) {

    const item = s.rows[e.row].dataItem;

    item.favorite = !item.favorite;

    s.collectionView.refresh();

    }

    });

    flex.cellEditEnded.addHandler((s: wjcGrid.FlexGrid, e: wjcGrid.CellEditEndingEventArgs) => {

    debugger;

    let col = s.columns[e.col].binding;

    switch (col) {

    case “pdf”:

    let valuePdf = s.getCellData(e.row,e.col,false)

    // update excel value

    s.setCellData(e.row, “excel”, !valuePdf);

    console.log(e);

    s.collectionView.refresh();

    break;

    case “excel”:

    let valueExcel = s.getCellData(e.row, e.col,false);

    // update excel value

    s.setCellData(e.row, “pdf”, !valueExcel);

    s.collectionView.refresh();

    break;

    }

    when i click check box this two handler fired.i am getting that error,sometimes hitting ,sometime getting error

  • Posted 9 February 2021, 1:01 am EST

    I’m unable to replicate the issue using the previously shared sample. Please share the exact steps to replicate the issue, also confirm if you are able to observe the issue in the shared sample too? If not, please share a sample that replicates the issue.

  • Posted 9 February 2021, 2:56 am EST

    if possible to implement in angular 2 code using

    1)when i click checkbox cellEditEnding not fired getting error

    ERROR TypeError: ‘ownKeys’ on proxy: trap returned duplicate entries

    <wj-flex-grid #flexGrid [ngClass]=“{‘animated’: animated}”

    headersVisibility=“Column”

    showSelectedHeaders=“All”

    [alternatingRowStep]=“0”

    [showMarquee]=“true”

    [autoGenerateColumns]=“false”

    [columnGroups]=“columns”

    (initialized)=“initializeGrid(flexGrid)”

    [itemsSource]=“data”>

    initializeGrid(flex: wjcGrid.FlexGrid) {

    flex.cellEditEnding.addHandler((s: wjcGrid.FlexGrid, e: wjcGrid.CellEditEndingEventArgs) => {

    debugger;

    let col = s.columns[e.col].binding;

    // update the original value

    // when the ratin start is clickced

    if (col === “Favorite”) {

    const item = s.rows[e.row].dataItem;

    item.favorite = !item.favorite;

    s.collectionView.refresh();

    }

    });

    flex.cellEditEnded.addHandler((s: wjcGrid.FlexGrid, e: wjcGrid.CellEditEndingEventArgs) => {

    debugger;

    let col = s.columns[e.col].binding;

    switch (col) {

    case “pdf”:

    let valuePdf = s.getCellData(e.row,e.col,false)

    // update excel value

    s.setCellData(e.row, “excel”, !valuePdf);

    console.log(e);

    s.collectionView.refresh();

    break;

    case “excel”:

    let valueExcel = s.getCellData(e.row, e.col,false);

    // update excel value

    s.setCellData(e.row, “pdf”, !valueExcel);

    s.collectionView.refresh();

    break;

    }

    });

    // let g = new ColumnGroupProvider(flex, this.columns);
    // //uncomment next line if you would like to select col range on click on column headers
    // g.selectOnClick = true;
    

    }

    constructor(private reportService:ReportService) {

    this.ratingTemplate = CellMaker.makeRating({

    range: [0, 1]

    });

    this.reportLink = CellMaker.makeLink({

    });

    this.reportService.reportUpdate().subscribe(data=>{

       })
    this.reportService.GetAllReportCategorieswithJson().subscribe(data=>{
           this.reportsData=data['GetAllReportCategoriesResult'];
            this.reportsData=Object.values(this.reportsData);
           // this.reportsData=Object.keys(data).map(function(key) {return this.reportsData[key];})            
            this.reportsData.forEach(data=>{
                this.reportName=data.Name;
                this.reportsDataReports.push(...data.Reports);
            })
            this.reportsDataReports.forEach((element,index)=>{
              Object.assign(this.reportsDataReports[index],{
                pdf: false,
                excel: false,
                html: false,
              })
             element.Email == 1 ? element.pdf = true : element.Email == 2 ? element.excel = true : element.Email == 3 ? element.html = true : ' '
            })
       }) 
    

    setTimeout(() => {

    this.data = new wjcCore.CollectionView(this.reportsDataReports, {

    calculatedFields: {

    Favorite: $ => +$.favorite

    }

    });

    }, 500);

    this.columns = [

    {

    header: “Favorite”,

    binding: “Favorite”,

    cellTemplate: this.ratingTemplate,

    align: “center”

    },

    {

    header: “Subscription”,

    columns: [

    { header: “PDF”, binding: “pdf” },

    { header: “Excel”, binding: “excel” },

    { header: “HTML”, binding: “html” }

    ]

    },

    { header: “Type”, binding: “reportName”, width: 250 },

    { header: “Report Name”, binding: “Name”, cellTemplate: this.reportLink, width: 500 }

    ];

    }

  • Posted 9 February 2021, 3:04 am EST - Updated 3 October 2022, 12:53 pm EST

  • Posted 9 February 2021, 3:54 am EST

    i got the issue where it is,it is in

    this.data = new wjcCore.CollectionView(this.reportsDataReports, {

    calculatedFields: {

    Favorite: $ => +$.favorite

    }

    });

    how can i bind in angular calculatedFields,if i am removing calculatedfiels issue resolved but favorite icon not shown in grid

  • Posted 10 February 2021, 3:32 am EST

    I have prepared a sample in Angular based on the code snippet but I’m unable to replicate the issue. Please refer to the following sample and let us know if we are missing something to replicate the issue:

    https://codesandbox.io/s/wijmo-angular-forked-kh4ec?file=/src/app/app.component.ts

    You may also share a fresh sample for us to investigate that replicates the issue.

  • Posted 6 August 2021, 9:39 am EST

    when i click fav icon type as detail report(row) its moved top(sorted) that working fine but where i am clicked that place still it is active favicon that type as difference(index as changed) we cannot see active icon here. we need to see here inactive mode.

    expected :we need to see here inactive mode.

    grid.hostElement.addEventListener(“click”, (e) => {

    let ht = grid.hitTest(e);

    if (ht.col === 0 && e.target.tagName === “LABEL”) {

    const cv = grid.collectionView;

    const item = grid.rows[ht.row].dataItem;

    const target_copy = Object.assign({}, item);

        if (target_copy.Favorite) {
          const index = cv.items.indexOf(item);
          let DataItems=Object.values(cv.items)
          DataItems.splice(index, 1);
          DataItems.unshift(item);
          cv.sourceCollection = DataItems;
          cv.refresh();
        } else {
          this.sortFavorite(cv);
        }
      }
    });
    

    }

    private sortFavorite(cv: wjcCore.CollectionView) {

    // sort the items using the Favorite property

    cv.sortDescriptions.push(new wjcCore.SortDescription(“FavoriteField”, false));

    // assign the sorted items as the sourceCollection

    cv.sourceCollection = cv.items;

    // refresh the view

    cv.refresh();

    // clear the sort

    cv.sortDescriptions.clear();

    }

    grid.cellEditEnding.addHandler((s, e) => {

    let col = s.columns[e.col].binding;

    if (col === ‘FavoriteField’) {

    const item = s.rows[e.row].dataItem;

    item.Favorite = !item.Favorite;

    this.isSelected = item.Favorite;

    this.iReportId = item.Id;

    this.action = ‘0’;

    item.Email = this.action;

    s.collectionView.refresh();

      }
    });
    

    its working chrome also

  • Posted 6 August 2021, 11:06 am EST - Updated 3 October 2022, 12:53 pm EST

  • Posted 9 August 2021, 7:49 am EST

    Hi,

    I’m sorry but I’m unable to understand the exact issue you are facing, could you please explain the issue in relation to the following sample(you may also update the sample and share updated sample of your own):

    https://codesandbox.io/s/wijmo-angular-forked-33j2w?file=/src/app/app.component.ts

    My understanding so far:

    • In the sample, click “Using calculated fields” column header to sort the column

    • click rating star of last row to select

    : rating star is activated

    • Now click a cell of another row

    : Rows gets sorted and newly selected item moves above the unselected items(sort behaviour)

    the above behaviour is correct.

    Please explain the next steps to observe the issue and the expected behaviour.

    Thank you

  • Posted 9 August 2021, 10:55 am EST

    example: if i am clicked 10 row fav icon cell this item moved top, but favicon still 10th place active status(after moved top next report is here). please refer above screen shot.it will not occurs every time, only some cases it is appear.

  • Posted 10 August 2021, 7:40 am EST

    Thank you for the additional information. I’ve updated the sample with the provided code snippet but am still unable to replicate the issue at my end. Please update the following sample to replicate the issue so that we could further investigate the root cause of the issue and assist you accordingly

    https://codesandbox.io/s/wijmo-angular-forked-ohkzm?file=/src/app/app.component.ts

  • Posted 10 August 2021, 10:13 am EST

    i am not facing issue in chrome, this issue occurs in IE,

    https://codesandbox.io/s/wijmo-angular-forked-ohkzm?file=/src/app/app.component.ts

    this url not running on ie

  • Posted 10 August 2021, 10:25 am EST

    5 to 10 times select favicon icon see icon is active same place or not

  • Posted 10 August 2021, 10:26 am EST

    i am facing this issue on ie only

  • Posted 11 August 2021, 2:25 am EST - Updated 3 October 2022, 12:53 pm EST

    I’m able to replicate the issue in IE11 as well. The observed issue is not related to the wijmo but it is IE bug. Sometimes, even if we are not hovering over the start icon, IE add the hovers style to it. Please refer to the gif below, in the gif notice that :hover style is applied on the star even though we are not hovering over it.

  • Posted 11 August 2021, 5:29 am EST

    there is no solution for this

  • Posted 12 August 2021, 1:52 am EST

    We are sorry but unfortunately, there is no workaround available for this.

Need extra support?

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

Learn More

Forum Channels