0
我想與其他queryParams一起使用Backbone.PageableCollection,但不起作用。Backbone.PageableCollection定義的搜索
我試過_.extend queryParams和狀態,但產生值=值查詢結果。例如,如果我將{gender:'male'}添加到queryParams和state,那麼查詢字符串是...?male = male ...我需要知道如何在服務器端解釋這個。我嘗試使用下劃線的反轉來有一個值=密鑰對,但這並沒有幫助。
的CoffeeScript:
class Entities.UserCollection extends Backbone.PageableCollection
initialize: (searchCriteriaModel) ->
_.extend(@queryParams, searchCriteriaModel)
_.extend(@state, searchCriteriaModel)
model: Entities.UserModel
url: '/api/ra/users'
state:
firstPage: 1
currentPage: 1
pageSize: 6
totalRecords: 200
任何幫助,將不勝感激