jQWidgets Forums

jQuery UI Widgets Forums Angular Angular – Grid – binding data

This topic contains 2 replies, has 2 voices, and was last updated by  Kavya 5 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Angular – Grid – binding data #111808

    Kavya
    Participant

    I have a grid where I assign url
    I change the url when the accountid changes.
    but the data is not loaded to the grid and still shows old data.
    I have also used onBindingComplete which keep loading the grid.

    Example
    projectSource: any =
    {
    datatype: ‘json’,
    cache: false,
    pagesize: 10,
    totalrecords: 0,
    pagenum: 0,
    datafields: [
    { name: ‘id’, type: ‘string’ },
    { name: ‘projectName’, type: ‘string’ },
    { name: ‘projectURLPath’, type: ‘string’ },
    { name: ‘createdDateTime’, type: ‘date’ },
    { name: ‘status’, type: ‘string’ },
    { name: ‘projectSize’, type: ‘number’}
    ],
    url: ‘/api/v1/account/’ + this.accountId + ‘/project/’,
    root: “data>projects”,
    pager: (pagenum: any, pagesize: any, oldpagenum: any): void => {
    this.currentPage = pagenum;
    this.pageSize = pagesize;
    },
    filter: () => {
    if(this.projectGrid){
    this.projectGrid.updatebounddata(‘filter’);
    }
    },
    sort: () => {
    if(this.projectGrid){
    this.projectGrid.updatebounddata(‘sort’);
    }
    },
    beforeprocessing: (data) => {
    if (data != null) {
    if(this.projectSource){
    this.projectSource.totalrecords = data[“data”].totalRows;
    this.totalItems = data[“data”].totalRows;
    }
    }
    },
    formatdata: (data) => {
    return data;
    }
    };

    Angular – Grid – binding data #111809

    admin
    Keymaster

    Hi Kavya,

    It is better to create a new dataAdapter and set the Grid’s source property to point to it.

    Hope this helps.

    Regards,
    Peter

    Angular – Grid – binding data #111975

    Kavya
    Participant

    HI

    DateTime filter is giving error if I assign url to source.

    TypeError: G.grid.source.formatDate is not a function at push../node_modules/jqwidgets-ng/__ivy_ngcc__/jqwidgets/jqxgrid.js.b.jqx.dataview.databind (jqxgrid.js:8)

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

You must be logged in to reply to this topic.