Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2pext
plugin_dbui
Commits
f179fe04
Commit
f179fe04
authored
12 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
Introduce the Store.restoreWhere method.
parent
51101337
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
static/plugin_dbui/src/grid.js
+5
-15
5 additions, 15 deletions
static/plugin_dbui/src/grid.js
static/plugin_dbui/src/jsonstore.js
+22
-0
22 additions, 0 deletions
static/plugin_dbui/src/jsonstore.js
with
27 additions
and
15 deletions
static/plugin_dbui/src/grid.js
+
5
−
15
View file @
f179fe04
...
...
@@ -88,31 +88,21 @@ App.grid.Grid = Ext.extend(Ext.grid.GridPanel, {
var
action
,
i
;
// private function to emit
t
the resetgrid event
// private function to emit the resetgrid event
function
fireReset
()
{
this
.
fireEvent
(
'
resetgrid
'
);
}
// parameters
for
the store load action
// parameters
defining
the store load action
action
=
{
callback
:
fireReset
,
scope
:
this
};
if
(
this
.
getBottomToolbar
()
instanceof
Ext
.
PagingToolbar
)
{
action
.
params
=
{
start
:
0
,
limit
:
this
.
nRows
};
}
// restore initial where condition of the store
// in order to remove filter condition
if
(
'
where
'
in
this
.
store
.
baseParams
)
{
if
(
this
.
store
.
initialWhere
)
{
this
.
store
.
baseParams
.
where
=
[];
for
(
i
=
0
;
i
<
this
.
store
.
initialWhere
.
length
;
i
+=
1
)
{
this
.
store
.
baseParams
.
where
.
push
(
this
.
store
.
initialWhere
[
i
]);
}
}
else
{
delete
this
.
store
.
baseParams
.
where
;
}
}
// in order to remove remote filter condition
this
.
store
.
restoreWhere
();
// reload the store and fire the resetgrid event
this
.
store
.
load
(
action
);
}
...
...
This diff is collapsed.
Click to expand it.
static/plugin_dbui/src/jsonstore.js
+
22
−
0
View file @
f179fe04
...
...
@@ -115,6 +115,28 @@ App.data.DirectStore = Ext.extend(Ext.data.DirectStore, {
store
.
totalLength
-=
1
;
break
;
}
},
/**
* Restore the where conditions to the original values.
* Useful to remove remote filter condition.
*/
restoreWhere
:
function
()
{
var
i
;
if
(
'
where
'
in
this
.
baseParams
)
{
if
(
this
.
initialWhere
)
{
this
.
baseParams
.
where
=
[];
for
(
i
=
0
;
i
<
this
.
initialWhere
.
length
;
i
+=
1
)
{
this
.
baseParams
.
where
.
push
(
this
.
initialWhere
[
i
]);
}
}
else
{
delete
this
.
baseParams
.
where
;
}
}
}
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment