Set query to search all fields of a dojo datagrid

烈酒焚心 提交于 2019-12-05 08:32:24
Kevin

Is your store an ItemFileReadStore or a QueryReadStore?

If ItemFileReadStore you may be able to utilize the AndOrReadStore http://dojotoolkit.org/reference-guide/dojox/data/AndOrReadStore.html

Otherwise, my best suggestion for a limited fetch store would be to adjust your back-end code to support filtering options such that when the store makes a POST(or GET), you parse out an array of fields that you want to search against, and the result set is returned accordingly.

You'd see something like

start 0
count 25
columnsToQuery : ["name","friend","family"]  //or perhaps a CSV string will do
columnOperator : "AND"
columnValue : "Bob"

You'd have to adjust the paradigm as per your business needs, but as long as the server can properly return the result set based on the filtering inputs this approach will work.

The call to generate such a request would be

grid.setQuery({
  columnsToQuery : ["name","friend","family"],
  columnOperator : "AND",
  columnValue : "Bob"
});
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!