jQWidgets Forums

jQuery UI Widgets Forums Getting Started jqxGrid.setcellvalue not working with angular8

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 5 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • jqxGrid.setcellvalue update value in jqxGrid but before rendering ZoneTask reset grid as before it.

    Can anyone please update me with this?

    Following is snippet for my code till now.

    Calling Getdata method for bind report

    buttonClicked() {
        this.getData();
        // update cells after bind grid.
        this.updatebounddata(this.firstLoadData);
      }

    `getData() {
    this.jqxLoader.open();
    this.reportSrv.getReportData(this.Id, moment(this.dateFrom, environment.dateFormat).toDate(), this.PeriodRange, this.aggregationColumns)
    .then(x => {
    const data = this.expandPeriodData(x);
    this.source.localdata = data;
    this.firstLoadData = data;
    this.jqxLoader.close();
    })
    .catch(x => {
    this.jqxLoader.close();
    alert(‘An error has occurred’);
    });
    }`

    update cell after bind grid

     updatebounddata(data) {
      if (data.length > 0) {
        for (let i = 0; i < data.length; i++) {
          this.jqxGrid.setcellvalue(i, 'Period1OH', 5.0)
          this.jqxGrid.setcellvalue(i, 'Period2OH', 5.0)
          this.jqxGrid.setcellvalue(i, 'Period3OH', 5.0)
          this.jqxGrid.setcellvalue(i, 'Period4OH', 5.0)
        }
      }
     }

    Peter Stoev
    Keymaster

    Hi,

    Instead of setting this.source.localdata, please create a new dataAdapter instance and set the Grid’s source property to it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.