【发布时间】:2012-01-30 15:36:23
【问题描述】:
我正在对商店执行远程过滤。
我的代码是这样的:
myStore.load({
limit: 8,
foo: 'foo is never sent',
filters:[{'property':'some property','value':30,'comparison':'lt','field':'age'}]
});
它最终使用 GET 方法发送到服务器,参数如下:(来自 chrome/firebug)
_dc:1327757119914
page:1
start:0
limit:8
filter:[{"property":"some property","value":30}]
请求的网址:
myServerPage.php?_dc=1327757119914&page=1&start=0&limit=8&filter=%5B%7B%22property%22%3A%22some%20property%22%2C%22value%22%3A30%7D%5D
'foo' 丢失了,更重要的是,在传递的 'filter' 对象中,只发送了 'property' 和 'value' 。 (我觉得这两个是预定义的,filter config不接受其他key和value)
如何使用 load() 将自己的参数发送到服务器,尤其是在“过滤器”部分?
【问题讨论】:
-
我认为您需要使用 real 示例来改进您的问题,因为不仅 foo 从未发送过,而且 filters - 相反,你说它发送 类似这样的东西(不是很精确)然后它包含 filter 而不是 filters
-
感谢您的建议。我进行了一些编辑以使其更易于理解。