jQWidgets Forums

jQuery UI Widgets Forums Angular beforeprocessing angular 2

This topic contains 1 reply, has 1 voice, and was last updated by  gab 7 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • beforeprocessing angular 2 #95626

    gab
    Participant

    I’ve always used the function beforeprocessing successfully in jquery, now with angular 2 I get this error:

    ReferenceError: source is not defined
    

    The source code is as follows:

    
      source: any =
      {
        datatype: "json",
        type: 'POST',
        data: this.data,
        datafields: this.datafields,
        addrow: function (rowid, rowdata, position, commit) {
    
        },
        deleterow: function (rowid, commit) {
    
        },
        updaterow: function (rowid, rowdata, commit) {
    
        },
        cache: false,
        root: 'annunci',
        id: 'id_annuncio',
        url: Constants.Default.ApiEndpoint + "/" + 'annuncio.php',
        sortcolumn: 'data_inserimento',
        sortdirection: 'desc',
        beforeprocessing: function (data) {
          source.totalrecords = data.TotalRows;
        }
      }
    

    some idea?

    beforeprocessing angular 2 #95633

    gab
    Participant

    Thanks to the same I solved that!

        beforeprocessing: function (data) {
          this['totalrecords'] = data.TotalRows;
        }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.