We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
關鍵字: remoteFilter
若要讓 grid 支援 Filter 功能步驟如下:
在 grid 新增 process config,新增 config = Utilities.createFiltersFeature(config);,將會根據 gird 之 columns 設定 filter
config = Utilities.createFiltersFeature(config);
grid column 是否用正確的 xtype 會影響 filter 的呈現,目前主要的對應:
請檢查 grid 是否有正確設定欄位型態,其中 id 請設為 numbercolumn
def index(Integer max) { def list = Item.createCriteria().list(params,params.criteria) render (contentType: 'application/json') { [itemInstanceList: list, itemInstanceTotal: list.totalCount] } }
目前是 grid 搭配 filter 加上分頁,所以必須使用 createCriteria,他會多處理一個 properties 為 totalCount,作為分頁情況下的總筆數,如果是原本的作法 [itemInstanceList: Item.list(params), itemInstanceTotal: Item.count()] 無法處理。
[itemInstanceList: Item.list(params), itemInstanceTotal: Item.count()]
其中 params.criteria 處理在 ExtJSFilters.groovy 將會解析由前端傳入的 filter 參數,因此所有 controller 不需重覆定義,直接從 params 取用即可。
ExtJSFilters.groovy
[ { "type": "string", "value": "222", "field": "name" }, { "type": "numeric", "comparison": "lt", "value": 1, "field": "dueDays" }, { "type": "numeric", "comparison": "gt", "value": 1, "field": "dueDays" }, { "type": "date", "comparison": "lt", "value": "10/02/2013", "field": "effectEndDate" }, { "type": "date", "comparison": "gt", "value": "10/16/2013", "field": "effectEndDate" }, { "type": "date", "comparison": "eq", "value": "10/23/2013", "field": "effectEndDate" } ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
關鍵字: remoteFilter
若要讓 grid 支援 Filter 功能步驟如下:
前端調整
在 grid 新增 process config,新增
config = Utilities.createFiltersFeature(config);
,將會根據 gird 之 columns 設定 filtergrid column 是否用正確的 xtype 會影響 filter 的呈現,目前主要的對應:
請檢查 grid 是否有正確設定欄位型態,其中 id 請設為 numbercolumn
controller 調整,以 itemController 為例
目前是 grid 搭配 filter 加上分頁,所以必須使用 createCriteria,他會多處理一個 properties 為 totalCount,作為分頁情況下的總筆數,如果是原本的作法
[itemInstanceList: Item.list(params), itemInstanceTotal: Item.count()]
無法處理。其中 params.criteria 處理在
ExtJSFilters.groovy
將會解析由前端傳入的 filter 參數,因此所有 controller 不需重覆定義,直接從 params 取用即可。查詢前端傳入的 filter json 範例
操作畫面
參考資料
The text was updated successfully, but these errors were encountered: