Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

Filter table values based on queryParams

$
0
0

Hello. I am implementing a filter table. After writing on the input fields and pressing the button. The value of the title is read and queryParams in the adapter is updated. Can anyone tell me how to update the table when queryParams are defined. This is the action

filterDocuments(param) {
        if (param !== '') {
          let model=this.modelFor("main.documents.table")
          var dcTitle=Ember.get(model,"dcTitle")
          this.get('documentsAdapter').filterDocuments(dcTitle, 1, ENV.APP.pageSize)

and my adapter is like this

filterDocuments(dcTitle, page, pageSize) {
       debugger;
       let queryParams = '';
      if(!isEmpty(page)){
        queryParams+=`page=${page}`
      }
      else{
        queryParams+='page=1'
      }
      if(!isEmpty(pageSize)){
        queryParams+=`&page_size=${pageSize}`
      }
      else{
        queryParams+='&page_size=15'
      }
      if(!isEmpty(dcTitle)){
        queryParams+=`&dc_title=${dcTitle}`
      }
      return this.get('ajax').request({
      url:
      `/admins/documents?${queryParams}`,
    });
  },

I want to know how can I get the url generated by the adapter and then show the table that matches the title entered.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles