return $(this.windowId + this.elements.toolbarSuffix).visible();
},
setActions: function() {
- var table = $(this.window).down('table');
- var checkboxes = table.select('input[name="actions_checkbox"]');
+ var checkboxes = this.getCheckboxes();
checkboxes.each(function(el) {
el.observe('change', function() {
- var is_checked = this.is_any_checked(checkboxes);
+ var is_checked = this.isAnyChecked(checkboxes);
if(is_checked === true && !this.areActionsOpen()) {
this.showActions();
} else if (is_checked === false && this.areActionsOpen()) {
}.bind(this));
}.bind(this));
},
- is_any_checked: function(checkboxes) {
+ isAnyChecked: function(checkboxes) {
var is_checked = false;
checkboxes.each(function(ch) {
if(ch.checked == true) {
return is_checked;
},
+ getCheckboxes: function() {
+ var checkboxes = $(this.gridEl).select('input[name="actions_checkbox"]');
+ return checkboxes;
+ },
+
+ areCheckboxesChecked: function() {
+ var checkboxes = this.getCheckboxes();
+ return this.isAnyChecked(checkboxes);
+ },
+
markAllChecked: function(check) {
this.checked = [];
- var table = $(this.window).down('table');
- var checkboxes = table.select('input[name="actions_checkbox"]');
+ var checkboxes = this.getCheckboxes();
var containerId;
if(checkboxes.length > 0) {
checkboxes.each(function(ch, index) {
<com:TCallback ID="ReloadClients" OnCallback="Page.ClientWindow.prepareData" ClientSide.OnComplete="SlideWindow.getObj('ClientWindow').setLoadRequest();" />
<script type="text/javascript">
var client_callback_func = function() {
+ /* If Client list window is not open or if actually toolbar is used
+ * then Client window refresh does not take place.
+ */
+ var obj = SlideWindow.getObj('ClientWindow');
+ if (obj.isWindowOpen() === false || obj.isToolbarOpen() === true) {
+ return;
+ }
var mainForm = Prado.Validation.getForm();
var callback = <%=$this->ReloadClients->ActiveControl->Javascript%>;
if (Prado.Validation.managers[mainForm].getValidatorsWithError('ClientGroup').length == 0) {
var job_callback_func = function() {
/*
* Check if Job list window is open and if any checkbox from actions is not checked.
+ * Also check if toolbar is open.
* If yes, then is possible to refresh Job list window.
*/
- if(SlideWindow.getObj('JobWindow').isWindowOpen() === true && SlideWindow.getObj('JobWindow').areActionsOpen() === false) {
- var mainForm = Prado.Validation.getForm();
- var callback = <%=$this->ReloadJobs->ActiveControl->Javascript%>;
- if (Prado.Validation.managers[mainForm].getValidatorsWithError('JobGroup').length == 0) {
- SlideWindow.getObj('JobWindow').markAllChecked(false);
- callback.dispatch();
- }
+ var obj = SlideWindow.getObj('JobWindow');
+ if (obj.isWindowOpen() === false || obj.areCheckboxesChecked() === true || obj.isToolbarOpen() === true) {
+ return;
+ }
+ var mainForm = Prado.Validation.getForm();
+ var callback = <%=$this->ReloadJobs->ActiveControl->Javascript%>;
+ if (Prado.Validation.managers[mainForm].getValidatorsWithError('JobGroup').length == 0) {
+ obj.markAllChecked(false);
+ callback.dispatch();
}
}
</script>
<com:TCallback ID="ReloadRunJobs" OnCallback="Page.JobRunWindow.prepareData" ClientSide.OnComplete="RunSlideWindow.getObj('JobRunWindow').setLoadRequest();" />
<script type="text/javascript">
var jobrun_callback_func = function() {
+ /* If Job Run list window is not open or if actually toolbar is used
+ * then Job Run window refresh does not take place.
+ */
+ var obj = SlideWindow.getObj('JobRunWindow');
+ if (obj.isWindowOpen() === false || obj.isToolbarOpen() === true) {
+ return;
+ }
var mainForm = Prado.Validation.getForm();
var callback = <%=$this->ReloadRunJobs->ActiveControl->Javascript%>;
if (Prado.Validation.managers[mainForm].getValidatorsWithError('JobRunGroup').length == 0) {
<com:TCallback ID="ReloadPools" OnCallback="Page.PoolWindow.prepareData" ClientSide.OnComplete="SlideWindow.getObj('PoolWindow').setLoadRequest();" />
<script type="text/javascript">
var pool_callback_func = function() {
+ /* If Pool list window is not open or if actually toolbar is used
+ * then Pool window refresh does not take place.
+ */
+ var obj = SlideWindow.getObj('PoolWindow');
+ if (obj.isWindowOpen() === false || obj.isToolbarOpen() === true) {
+ return;
+ }
var mainForm = Prado.Validation.getForm();
var callback = <%=$this->ReloadPools->ActiveControl->Javascript%>;
if (Prado.Validation.managers[mainForm].getValidatorsWithError('PoolGroup').length == 0) {
<com:TCallback ID="ReloadVolumes" OnCallback="Page.VolumeWindow.prepareData" ClientSide.OnComplete="SlideWindow.getObj('VolumeWindow').setLoadRequest();" />
<script type="text/javascript">
var volume_callback_func = function() {
+ /*
+ * Check if Volume list window is open and if any checkbox from actions is not checked.
+ * Also check if toolbar is open.
+ * If yes, then is possible to refresh Volume list window.
+ */
+ var obj = SlideWindow.getObj('VolumeWindow');
+ if (obj.isWindowOpen() === false || obj.areCheckboxesChecked() === true || obj.isToolbarOpen() === true) {
+ return;
+ }
var mainForm = Prado.Validation.getForm();
var callback = <%=$this->ReloadVolumes->ActiveControl->Javascript%>;
if (Prado.Validation.managers[mainForm].getValidatorsWithError('VolumeGroup').length == 0) {
- SlideWindow.getObj('VolumeWindow').markAllChecked(false);
+ obj.markAllChecked(false);
callback.dispatch();
}
}