Show="true"
Label="<%[ Bandwidth limit ]%>"
UnitType="decimal"
+ Attributes.onkeyup="var kc = (event.which || event.keyCode); if (kc == 13) oClientBandwidthLimit.set_bandwidth(); if (kc == 27) oClientBandwidthLimit.close_popup();"
/>
</div>
</div>
},
open_popup: function() {
document.getElementById(this.ids.popup).style.display = 'block';
+ document.getElementById('<%=$this->BandwidthLimit->Directive->ClientID%>').focus();
},
close_popup: function() {
document.getElementById(this.ids.popup).style.display = 'none';
var val = Units.format_speed(value, null, false, true);
bwlimit_val.value = val.value;
bwlimit_unit.value = Units.get_short_unit_by_long('speed', val.format) || val.format;
+ },
+ set_bandwidth: function() {
+ $('#<%=$this->SetBandwidthLimit->ClientID%>').click();
}
};
</script>
}
}
+ public function copyAttributes() {
+ $control = $this->findControl('Directive');
+ if ($control instanceof \Prado\Web\UI\TControl) {
+ $control->getAttributes()->copyFrom($this->getAttributes());
+ }
+ }
+
public function saveValue($sender, $param) {
$command_param = $this->getCmdParam();
if ($command_param === 'save' && method_exists($this, 'getValue')) {
if (!$this->getIsDirectiveCreated()) {
$this->createDirective();
$this->setIsDirectiveCreated(true);
+ $this->copyAttributes();
}
// show directives existing in config or all
Show="true"
Label="<%[ Bandwidth limit ]%>"
UnitType="decimal"
+ Attributes.onkeyup="var kc = (event.which || event.keyCode); if (kc == 13) oJobBandwidthLimit.set_bandwidth(); if (kc == 27) oJobBandwidthLimit.close_popup();"
/>
</div>
</div>
},
open_popup: function() {
document.getElementById(this.ids.popup).style.display = 'block';
+ document.getElementById('<%=$this->BandwidthLimit->Directive->ClientID%>').focus();
},
close_popup: function() {
document.getElementById(this.ids.popup).style.display = 'none';
var val = Units.format_speed(value, null, false, true);
bwlimit_val.value = val.value;
bwlimit_unit.value = Units.get_short_unit_by_long('speed', val.format) || val.format;
+ },
+ set_bandwidth: function() {
+ $('#<%=$this->SetBandwidthLimit->ClientID%>').click();
}
};
</script>