How to get All the rows from wijmo flexgrid with pagination

Posted by: teenu.k on 14 July 2020, 11:38 am EST

  • Posted 14 July 2020, 11:38 am EST

    Hi,

    In my wijmo flexgrid (having pagination) , at some point i need to update one or more rows inside the flexgrid.

    In the dataItem of each row i have a unique id. according to that i need to find the specific row and need to update that row in the grid. (using angular)

    In my html— [itemsSource]=“invoiceItemsSource”

    and in component.ts file

    this.invoiceItemsSource = new CollectionView(this.Data);

    this.invoiceItemsSource.pageSize = 10;

    I tried the below code

    for(let i=0; i < this.flexTable.rows.length;i++){

    if(this.flexTable.rows[i].dataItem.id == initialTechId){

    this.flexTable.rows[i].dataItem=data;

    this.flexTable.refreshCells(true);

    break;

    }

    }

    but it only works for the current page. if the row is in next page how to upadte that …currently i am getting only current 10 rows.

    Thanks,

    Teenu

  • Posted 15 July 2020, 2:58 am EST

    Hi Teenu,

    The paging is done on CollectionView and not on FlexGrid. If you have set the pageSize to 10, then only 10 rows are displayed because only 10 rows are created in the FlexGrid. All the remaining data is stored in the collectionview itself and not in the FlexGrid. So, if you need to update a dataitem, you will have to iterate over the items in the CollectionView instead of the rows:

    for(let i=0; i < this.invoiceItemsSource.totalItemCount;i++){
    	if(this.invoiceItemsSource.sourceCollection[i].id == initialTechId){
    		this.invoiceItemsSource.sourceCollection[i] = data;
    		this.invoiceItemsSource.refresh():
    		break;
    	}
    }
    

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels