diff --git a/modules/plugin_dbui/converter.py b/modules/plugin_dbui/converter.py index 66ef65affb7ab7537da6edb427cea3677cefc91c..11325d011c4dcc6d9c5891f56c74f6b44c11f07c 100644 --- a/modules/plugin_dbui/converter.py +++ b/modules/plugin_dbui/converter.py @@ -618,12 +618,16 @@ def to_jsonstore(table, **kwargs): db = table._db tablename = table._tablename - # NOTE: the configuration option baseParams defined the - # transactions parameters seen by the server + # NOTE: the configuration option extraParams defined the + # transactions parameters received by the server. + # # This dictionary contains 3 keys: # tablename: name of the table in the database # dbFields: list of fields which should be red # where: define inner join, mainly to resolve foreign key + # + # NOTE: the keyword pageParam allow to activate / inhibit pagination + # It should be equal ro "page" or undefined respectively. base_params = {'tableName': tablename, 'dbFields': []} cfg = DirectStore(autoLoad=False, @@ -631,6 +635,7 @@ def to_jsonstore(table, **kwargs): extraParams=base_params, idProperty=encode_field(tablename,'id'), model=tablename, + pageParam="", root=ROOT, successProperty=SUCCESS, storeId=get_store_id(tablename), diff --git a/modules/plugin_dbui/dbsvc.py b/modules/plugin_dbui/dbsvc.py index d420e285214a157ac45cebdd07d05dc0111c4ef6..b95768732ad01e95a627fcc5c9fe6eb7a94d6cca 100644 --- a/modules/plugin_dbui/dbsvc.py +++ b/modules/plugin_dbui/dbsvc.py @@ -617,6 +617,7 @@ class DbSvc(BaseSvc): The transaction data can also contains parameters useful for paging. For more detail see Ext.PagingToolbar: + - page - start - limit - sort @@ -664,9 +665,9 @@ class DbSvc(BaseSvc): elif q_filter and tablename not in db: nrecords = len(db(q_filter).select(db[tablename].id)) - # handle paging options (see Ext.PagingToolbar) + # handle paging options kwargs = {} - if 'start' in arg and 'limit' in arg: + if 'page' in arg: start = int(arg['start']) limit = int(arg['limit']) kwargs['limitby'] = (start, start+limit) diff --git a/static/plugin_dbui/src/directstore.js b/static/plugin_dbui/src/directstore.js index ebfc0468fc00272d1201eb8469a2b1e74c058172..a3f8705515944841729b73654193e89a20d4c2d7 100644 --- a/static/plugin_dbui/src/directstore.js +++ b/static/plugin_dbui/src/directstore.js @@ -12,6 +12,7 @@ * - **{@link Ext.data.proxy.Direct proxy}** * * - **{@link Ext.data.proxy.Direct#extraParams extraParams}** + * - **{@link Ext.data.proxy.Direct#pageParam pageParam}** * * - **{@link Ext.data.reader.Json JsonReader}** * @@ -45,7 +46,12 @@ Ext.define('App.data.DirectStore', { proxy = { type: 'xdirect' }; - Ext.copyTo(proxy, config, 'extraParams,idProperty,root,successProperty,totalProperty'); + Ext.copyTo(proxy, config, ['extraParams', + 'idProperty', + 'pageParam', + 'root', + 'successProperty', + 'totalProperty']); config.proxy = proxy; }